On 26/11/11 21:36, Karsten Bräckelmann wrote:
On Sat, 2011-11-26 at 19:46 +0000, Ned Slider wrote:
# URIs matching http://some.domain.com/profile/12FirstLastname/
uri LOCAL_URI_PROFILE
m{https?://.{1,40}/profile/\d\d[A-Z][a-z]{1,20}[A-Z][a-z]{1,20}/}
^^^^^^^
Using [^/]+ for the domain part instead should be slightly more
efficient, since it will never result in backtracking. Also stricter,
since it anchors the /profile directory at the domain.
Now you made me go away and read the perl RE manual!
Nice - [^/] meaning to match any character that is not a "/", one or
more (+) times. I'd not come across negated character classes before so
thanks for the tip!
And anchoring the /profile directory at the domain definitely reduces
the likelihood of FPs.