Prasad, Ramit wrote:
m = re.search("[A-Z]{3}[a-z][A-Z]{3}", line)That is the expression I would suggest, except it is still more efficient to use a compiled regular expression like the original version.
Not necessarily. The Python regex module caches recently used regex strings, avoiding re-compiling them when possible.
However there is no guarantee on how many regexes are kept in the cache, so if you care, it is safer to keep your own compiled version.
-- Steven _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
