Skip to content

Instantly share code, notes, and snippets.

@kuozo
Created August 20, 2012 04:05
Show Gist options
  • Save kuozo/3400649 to your computer and use it in GitHub Desktop.
Save kuozo/3400649 to your computer and use it in GitHub Desktop.
re collect
import re
re.search('[0-9]','2') #-->True
re.search('[0-9]','2a') #-->True
re.search('^[0-9]$', '2') #-->True
re.search('^[0-9]$', '22') #-->False
re.search('^[0-9]{1,2}$', '22') #-->True
re.search('^[0-9]{1,}$', '22') #-->True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment