Don't understand this match
Julian Field
MailScanner at ecs.soton.ac.uk
Wed Mar 1 20:51:13 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Richard Thomas wrote:
> I'm not understanding why a certain filename has triggered the "Attempt
> to hide real filename extension" rule. The filename is
>
> Shortcut 29 t.xls
>
> The rule is \.[a-z][a-z0-9]{2,3}\s*\.[a-z0-9]{3}$
>
> As I understand it, that should match a period, followed by an alpha,
> followed by two or three alphnumerics, any amount of whitespace and
> then another period then an alphanumeric three character alphanumeric
> extension all of this being at the end of the filename.
>
> The filename in question has only one period.
>
> Of course, I'm not sure which particular version of regular
> expressions MailScanner uses (maybe the period is the "match any
> character" period.
It uses Perl's regular expressions. In all regular expressions that I
know of, an unescaped "." means match "any single character".
>
> Is there a bug in the regexp? Is this actually a valid match? Is this
> just a case of "upgrade to the latest"? Possibly I am just wildly out
> of date :)
This regexp is just fine, it has been there for several years without
any changes whatsoever. I wrote it carefully and got it right first time.
- --
Julian Field
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
Professional Support Services at www.MailScanner.biz
MailScanner thanks transtec Computers for their support
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.0.5 (Build 5050)
iQA/AwUBRAYJQhH2WUcUFbZUEQLIugCgpWQ7nWF+qLZVixRS0jzdoNitJBEAoIw+
6iyApxbzbUb/iANO+wFwgW7D
=o6hB
-----END PGP SIGNATURE-----
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the MailScanner
mailing list