in reply to Grab "as many occurrences as there are" in a long string
contains three occurrences of "FOO something BAR". You can still get all matches with a regexp:"zero FOO one two BAR three FOO four five BAR six"
$_ = "zero FOO one two BAR three FOO four five BAR six"; /(FOO.*BAR)(??{ say $1 })(*FAIL)/; __END__ FOO one two BAR three FOO four five BAR FOO one two BAR FOO four five BAR
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Grab "as many occurrences as there are" in a long string
by locked_user sundialsvc4 (Abbot) on Sep 24, 2010 at 13:30 UTC | |
by JavaFan (Canon) on Sep 24, 2010 at 13:39 UTC |