in reply to Help with placing the matches of a regex into an Array
I can make the match work by removing the square brackets (character class):
while ( my $link = <DATA> ){ $link =~ m/onclick="document\.location\.href='(.+)'"/g; say $1; } __DATA__ onclick="document.location.href='hello'" onclick="document.location.href='there'" onclick="document.location.href='world'" __END__ %./match.pl hello there world
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with placing the matches of a regex into an Array
by LanX (Saint) on Apr 28, 2012 at 15:58 UTC | |
by stevieb (Canon) on Apr 28, 2012 at 16:05 UTC |