Skip to content

Instantly share code, notes, and snippets.

@EdwardIII
Created August 3, 2012 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EdwardIII/3246218 to your computer and use it in GitHub Desktop.
Save EdwardIII/3246218 to your computer and use it in GitHub Desktop.
>>> s = 'data_sheet_-_z124251.jpg'
>>> r = re.compile(r'([a-z0-9])+', re.IGNORECASE)
>>> r.search(s).group()
'data'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment