Rexexp on part of a string

Andrew Black andrew-li at
Tue Feb 19 06:35:16 GMT 2008

I would like to restrict the part of a string a regexp is allowed to 
operate on, For example I would like to ignore comments.
I would like

   $x = " andrew andrew   # andrew " ;
   $x =~ s/andrew/black/g ;
to produce " black black   # andrew "

More information about the mailing list