RE strings (was: Variable Interpolation - status of PEP 215)

Cimarron Taylor cimarron+google at taylors.org
Thu Jun 20 15:56:47 EDT 2002


I like it! 

To me

  m = re'^EMP:([^,]*),([^,]*),([^,]*),([^,]*)$'.match(line)
  if m:
        ...

is much clearer and more maintainable than

  import re
  emp_re = re.compile(r'^EMP:([^,]*),([^,]*),([^,]*),([^,]*)$')
  m = re.match(emp_re, line)
  if m:
      ...

Cim



More information about the Python-list mailing list