in reply to Parsing with RegEx into Array
$str =~ m{<item><i>(.*?)</i></item>}
You want to match multiple times.
$str =~ m{<item><i>(.*?)</i></item>}g
If that is in list context, it will return a list of what was captured.
my @x = $str =~ m{<item><i>(.*?)</i></item>}g;
Same thing, but more flexible when you have multiple captures:
my @x; while ($str =~ m{<item><i>(.*?)</i></item>}g) { push @x, $1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing with RegEx into Array
by mr_p (Scribe) on Jun 25, 2010 at 20:47 UTC | |
by ikegami (Patriarch) on Jun 25, 2010 at 21:35 UTC | |
| |
|
Re^2: Parsing with RegEx into Array
by mr_p (Scribe) on Jun 25, 2010 at 18:17 UTC | |
by ikegami (Patriarch) on Jun 25, 2010 at 18:31 UTC | |
by JediWizard (Deacon) on Jun 25, 2010 at 18:31 UTC |