Michael Hutchinson wrote:
>
> But only match it from the last trailing / character. In other words, if
> the message carries a link to "card.exe" at any address, it will be
> marked up.
>
> My thoughts were that all I would need is a rule like:
> uri MY_EXE_URI /card.exe/i
>   
Caution: . is a wildcard, so the above will match "card exe" "card1exe" etc.

Add a \ to force it to be a literal period character.

uri MY_EXE_URI /card\.exe/i

That still runs some risk of matching things you don't want, like parts
of the domain, etc.

I might tighten it up a bit more by adding the / in. trying to match
"/card.exe" instead of just "card.exe"
Again, we need a \ or the / will be interpreted as the end of the
expression, so we add \/

uri MY_EXE_URI /\/card\.exe/i


> Or do I need to actually match all of the stuff before that, using a
> wildcard for example? 
>   
No, you don't. Regexes will match a substring. Adding .* to the
beginning or end of a regex is a superfluous waste, and has no affect
whatsoever on the strings matched.

( note:  .* is regex syntax for 0 or more wildcards, equivalent to a
command-line *)
> Thanks in advance for any light shed upon the matter,
>
>   

Reply via email to