Created
August 20, 2012 04:05
-
-
Save kuozo/3400649 to your computer and use it in GitHub Desktop.
re collect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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