Title: RE: Rule Effeciency

> Secondly, if you really want to, you can shorten it a little
> by condensing common prefixes.  And third, you can replace (
> with (?: so it doesn't try to capture the match.  So in the
> end you get

Do you know of any online guides that describe "capturing the match" in more detail?  I'm finding this concept difficult to grasp. 

>  From =~
> /[EMAIL PROTECTED](?:ar|c(?:o\.(?:nz|za)|[ahz])|d[ek]|f[ir]|i[el]|l[tu]|m
> x|[np]l|ru|tw).?$/i
>
> More efficient, at least marginally.  Whether or not it's
> more readable is up to you to decide.  You might also consider instead
>
>  From =~
> /\.(?:ar|c(?:o\.(?:nz|za)|[ahz])|d[ek]|f[ir]|i[el]|l[tu]|mx|[n
> p]l|ru|tw).?$/i
>
> Which only specifies that it be at the end of the From line,
> and not that there be a @ before it.  Might be a little more
> efficient, and shouldn't be much different.  And I'm not sure
> of the purpose of the .? at the end.

The .? at the end was used to match from lines that looked like:
From: Jason Burzenski ([EMAIL PROTECTED])
Or
From: Jason Burzenski "[EMAIL PROTECTED]"

While still making sure the TLD part of the domain name was at the end of the line (to prevent things like identifying [EMAIL PROTECTED] due to .fr)

Thanks for all of your help.

Jason

Reply via email to