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
In reply to Re: Help with placing the matches of a regex into an Array
by stevieb
in thread Help with placing the matches of a regex into an Array
by kereekerra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |