convert a string to a regex?

Peng Yu pengyu.ut at gmail.com
Wed Nov 18 21:51:37 EST 2009


There are many special characters listed on
http://docs.python.org/library/re.html

I'm wondering if there is a convenient function that can readily
convert a string with the special characters to its corresponding
regex. For example,

"some.thing" => "some\.thing"



More information about the Python-list mailing list