in reply to Pattern Matching with REGEXP: Is the match position trackable?

while( /(?<=H)5+(?=H)/g ){ print pos; }

I recommend perlre. Also, using a range with a lower limit of 1 and no upper limit is functionally equivalent to using + but more expensive.

UPDATE: Note the use of a look-ahead for the second H, this is to allow the trailing H of one 5 to serve as the leading H of another 5.

--
perl -pew "s/\b;([mnst])/'$1/g"

  • Comment on Re: Pattern Matching with REGEXP: Is the match position trackable?
  • Download Code