ignore special characters in python regex

John Machin sjmachin at lexicon.net
Tue Jul 21 02:01:38 EDT 2009


On Jul 21, 3:02 pm, Astan Chee <astan.c... at al.com.au> wrote:
> Hi,
> I'm reading text from a file (per line) and I want to do a regex using
> these lines but I want the regex to ignore any special characters and
> treat them like normal strings.
> Is there a regex function that can do this?

It would help if you were to say

(1) what "ignore ... characters" means -- pretend they don't exist?
(2) what are "special chararacters" -- non-alphanumeric?
(3) what "treat them like normal strings" means
(4) how you expect these special characters to be (a) ignored and (b)
"treated like normal strings" /at the same time/.

Cheers,
John



More information about the Python-list mailing list