ignore special characters in python regex

Frank Buss fb at frank-buss.de
Tue Jul 21 01:18:01 EDT 2009


Astan Chee wrote:

> 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?

Maybe re.escape helps?

-- 
Frank Buss, fb at frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de



More information about the Python-list mailing list