Skip to content

Instantly share code, notes, and snippets.

@offby1
Created May 14, 2016 23:01
Show Gist options
  • Save offby1/a90b92fa39ec6e806d1d5a688fe55741 to your computer and use it in GitHub Desktop.
Save offby1/a90b92fa39ec6e806d1d5a688fe55741 to your computer and use it in GitHub Desktop.
>>> [m.groups() for m in [re.match(r'abc(\d+)def', x) for x in ['abc14def', 'xyz38def', 'asdf', 'abc3def']] if m]
[('14',), ('3',)]
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment