> -----Original Message-----
> For the most part you can match any character by the appearance of the
> character.  Any character with special meaning needs to be escaped in
some
> way.  The easiest way is usually with a backslash, but in some cases
you
> can
> also do it by making it a member of a character class.
> 
> So for you questionmark case, you could do \? or [?], as most of the
> special
> characters lose their meaning in a character class.  The exceptions
are
> obviously right bracket, backslash, and dash becomes special if it
isn't
> the
> first character.
> 
> > /\=\?koi8\-r\?/

This is what I'd setup originally, except when I ran it past a RE
interpreter the results were just.. wrong. I do think it would work,
however, and will be testing it on a Virtual Machine today to be sure.

> This should work.  You don't need to escape the dash, and I'm pretty
sure
> you don't need to escape the equal sign; just the questionmark.
> 
> Also, you may want to handle this in both uppercase and lowercase, so
you
> could do
> 
>     /=\?koi8-r\?/i
> 
> And you probably don't need the = sign to get reasonably reliable
> matching.
 
Ah, this is the bit I was unsure about, limiting how many characters are
escaped. I would tend towards the fully escaped one myself, I just
wouldn't trust non-escaped = and ? signs. But that's probably got to do
with some bad history with Spamassassin:)

Thanks for reinforcing some points with RE that needed to be (:

Cheers,
Mike


Reply via email to