The re ModuleGeneral idea
Exampleimport re pat = r'(\d+)\.(\d*)' # My pattern r = re.compile(pat) # Compile it m = r.match(s) # See if string s matches if m: # Yep, it matched ... else: # Nope. ... |
<<< | O'Reilly OSCON 2000, Advanced Python Programming, Slide 27 July 17, 2000, beazley@cs.uchicago.edu |
>>> |