regex that is equivalent to perl's syntax

Lee Sander lesande at gmail.com
Mon Nov 12 10:38:57 EST 2007


hi,
does python's re library have a similar capability of the perls
regular expression to
search for pattern that appears a variable number of times within the
lower and upper bounds given? For example, what is the python's
equivalent to the following perl's search string?
m/^\S{1,8}\.\S{0,3}/
which seeks to find all strings with 8 characters followed by a dot
and then three more characters as in filename.txt

Actually, i need to find a pattern such as ABCDXLMNO with the
character X
repeated 5 to 8 times.

thanks
lee




More information about the Python-list mailing list