in reply to Regex and \G
my @lines = q[ X Y]; foreach(@lines){ s/\G {8}/warn pos();'G'/ge; } die qq['],@lines,q[']; __END__ 0 at - line 3. 8 at - line 3. 'GGX Y' at - line 5.
I can only assume that the first time it encounters a line, \G is set to 0 - i.e. the beginning of the line. Is this the case?You don't have to assume, just use re 'debug'; and watch the output fly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex and \G
by Melly (Chaplain) on Oct 23, 2003 at 09:36 UTC |