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