in reply to Series of REGEX with OR
$1... Contains the subpattern from the corresponding set of capturing parentheses from the last successful pattern match
Some of your regexen do have capture but not all of them.If the last regex tested does NOT have (capturing parens), $1 will not have a value, resulting the warning you are getting.
If you expect the URL only after "Archive", you can capture it thus:
... && my ($url)= $line =~ m/\/Archives(.*)/img && ...
This is not an optical illusion, it just looks like one.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Series of REGEX with OR
by wrkrbeee (Scribe) on Apr 27, 2016 at 17:24 UTC | |
by Preceptor (Deacon) on May 04, 2016 at 13:16 UTC |