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,781 of 87,272   
   Sylvain Robitaille to Mike Spencer   
   Re: CORRECTION Re: regex question   
   03 Oct 24 13:48:07   
   
   From: syl@therockgarden.ca   
      
   On 2024-10-01, Mike Spencer wrote:   
   >   
   >> I think Perl would say,   
   >>   
   >>      s/]+)>//;   
   >>   
   >> where "[^>]" is "any char not '>'".   
   >   
   > Apparently wrong. :-\   
   >   
   > From the command line:   
   >   
   >     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 "... ' |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.   
      
   --   
   ----------------------------------------------------------------------   
   Sylvain Robitaille                                syl@therockgarden.ca   
   ----------------------------------------------------------------------   
      
   --- 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