[Solved] How can I take integer regex?


As others have posted, the regular expression you are looking for is:

\d{4}-\d{6}

The full code I would use:

import re

my_string = 'Ticketing TSX - 2016-049172'
matches = re.findall(r"\d{4}-\d{6}", my_string)

print matches

If, for example, the length of the second digit varies from 6 to 8 digits, you will need to update your regular expression to this.

\d{4}-\d{6,8}

All of the details about regex and using regex in Python is available in the docs

solved How can I take integer regex?