in reply to Re^6: Progressive matching w/substitutions (pos)
in thread Progressive matching w/substitutions
Common sense. Confirmed by observation.
Actually, I have a module that supports just this type of thing and more that I hope to finish and release to CPAN this year, anyway.
pos doesn't apply to s/// just like it doesn't apply to pack/unpack or anything else. pos only talks about m//g and that is the only thing that it applies to. It doesn't talk about the things that it doesn't apply to and it doesn't apply to s/// nor split. Similar for \G.
The way you run code between steps of s/// is to use s//.../ge. You can't do that with m//g and, similarly, you can't do while( s///g ) { .... }.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Progressive matching w/substitutions (pos)
by argv (Pilgrim) on Aug 11, 2008 at 02:46 UTC | |
by tye (Sage) on Aug 11, 2008 at 04:19 UTC |