Created
November 25, 2012 04:15
-
-
Save 8bit-pixies/4142374 to your computer and use it in GitHub Desktop.
chall113
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 | |
from string import strip | |
def blueS(string): | |
if re.search("^\d+\.\d+$",strip(string)): | |
return 'float' | |
elif re.search("^\d\d-\d\d-\d{4}$",strip(string)): | |
return 'date' | |
elif re.search("^[-+]?\d+$",strip(string)): | |
return 'int' | |
else: | |
return 'text' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment