in reply to Help constructing a regex that also matches hyphens and parentheses
\w matches neither hyphens nor parentheses; to quote the documents (perlre) "\w Match a "word" character (alphanumeric plus "_").". You'll have to explicitly add the hyphen them to the regex.. Your regex will also fail for </TD>, which may not be what you want.
However, given your stated goal ("…I need it to match the entire line in $1 before it finds the </td>"), it would seem to me that your regex could just as easily read something like this:
which, at first glance, looks as if it may work: everything up to </td> gets slurped into $1. Note that this WAS NOT TESTED.push(@found_items, $1) if $data =~ m!(.*)</td>!i;
emc
"Being forced to write comments actually improves code, because it is easier to fix a crock than to explain it. "
|
|---|