Next / Previous / Contents / TCC Help System / NM Tech homepage

28.5.3. Compiled regular expression objects

Compiled regular expression objects returned by re.compile() have these methods:


If the start of string s matches, return a MatchObject; if there is no match, return None. If ps is given, it specifies the index within s where matching is to start; this defaults to 0. If pe is given, it specifies the maximum length of s that can be used in matching.


The string from which this object was compiled.


Like match(), but matches anywhere in s.


Like re.split().


Like re.sub().