in reply to Delving the regexp underdark -- how to understand \G's behavior, or how to loop through a regular expression
and the output:#!perl undef $/; $text = <DATA>; while ($text =~/foo(.*?)bar/g) { manipulate ($1) } sub manipulate { print "@_\n"; } __DATA__ foo this is one example bar this is a line I don't care about foo here's another keeper! bar foo yet another bar and a line to reject
Please provide some code, whether it's your original code or a short snippet, that actually demonstrates the problem you are having.this is one example here's another keeper! yet another
|
|---|