in reply to Re^2: Regex, capturing variables vs. speed
in thread Regex, capturing variables vs. speed
It's always better to write (\S*)\s than (.*?)\s, because you're making it clear to the matching engine exactly what you're looking for (non-space characters in this case).'Better' => sub { $line =~ /(chr\S*).*?urn:lsid:(\S*).*?panel:([^:]*)/i }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Regex, capturing variables vs. speed
by albert (Monk) on Oct 30, 2005 at 21:06 UTC |