in reply to (bbfu)(regex engine bug)Re: Re: RE prollem: \G, \\? and disappearing data
in thread RE prollem: \G, \\? and disappearing data
It looks like Perl 5.005_03 simply ignores the \G anchor when a '?' modifier is present. It also ignores \G if there's a {0,1} modifier, but oddly enough, not in the cases of '*' or '{0,2}'. Though not quite accurate, perhaps one of these is a suitable substitute.
Another option is to expand the '?' modifier into its two possibilities like so:
You can also dispense with the \G modifier altogether, and just slurp away the lexed tokens, using s/TOKEN// for matching, though this method is somewhat less efficient.m/\G(\\\$\w+|\$\w+)/gc
MeowChow s aamecha.s a..a\u$&owag.print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(bbfu)(MeowChow's workarounds)Re: Re: (RE bug)Re: Re: RE prollem: \G, \\? and disappearing data
by bbfu (Curate) on Feb 12, 2001 at 15:41 UTC |