Fb119, how to match FB and 119 separately? Write a few feel very cumbersome, do not know if there is a better way to write. thank you.
num = re.search (r'(d)+', ''FB119').group()eng = re.search Is there a better way to write (R '([a-za-z]) +','fb119 '). Group()?
Returns a tuple:
I don't know what you mean. Do you mean "named capture"? For example:
>>> s = 'FB119'
>>> import re
>>> m = re.match(r'(?P<a>[a-zA-Z]+)(?P<b>[0-9]+)', s)