New to using re. Search for a number before a string.
jbarber at iliff.edu
Sat Nov 2 14:03:10 CET 2013
I'm guessing that the name "FUDD, ELMER" varies. In that case, you might try something like this:
>>> id_num_regex = re.compile(r'\d+(?=\w+\b,.+?)')
This would account for first names such as 'Mary Ann' and also automatically matches characters only to the end of the line, since you have not flagged re.DOTALL.
More information about the Python-list