home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.linux.slackware      I think its the one without Selinux crap      87,272 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 86,782 of 87,272   
   Mike Spencer to Sylvain Robitaille   
   Re: CORRECTION Re: regex question   
   07 Oct 24 02:58:55   
   
   From: mds@bogus.nodomain.nowhere   
      
   Sylvain Robitaille  writes:   
      
   > On 2024-10-01, Mike Spencer wrote:   
   >   
   >>     perl -n -e 's/]+)>//;print;'   
   >>   
   >> This fails.  "> figured out why.  This works as expected:   
   >>   
   >>     perl -n -e s/]+)>//;   
   >> ...   
   >> Sorry. It was late and I didn't test my own advice.  Now trying to   
   >> figure out why the first one fails.   
   >   
   > The best that I can tell, is it looks like the shell is grabbing the   
   > "!-" sequence, and apparently leaving behind only the "!".  Try your   
   > first approach, and let it fail, then using command history, review the   
   > command.  Notice that it now says "...  I'm seeing with tcsh.   
      
      
   Yes.  Good catch.  I do most command line stuff in emacs shell where   
   command history comes from emacs, not the shell.  If I do as you   
   suggest in an xterm, just what you say happens!   
      
   >   
   >    : elvira[syl] ~; echo '' |perl -n -e 's/]+)>//;print;'   
   >       
   >   
   > (press the "up" cursor key ...)   
   >   
   >    : elvira[syl] ~; echo '' |perl -n -e 's/]+)>//;print;'   
   >   
   > If instead I escape the "!", it's handled as you intended:   
   >   
   >    : elvira[syl] ~; echo '' | perl -n -e 's/]+)>/<\!--   
   $1-->/;print;'   
   >       
   >   
   > I hope that this helps.   
      
   TYVM.   
      
   --   
   Mike Spencer                  Nova Scotia, Canada   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca