Wednesday, November 4, 2015

types library in python

https://docs.python.org/2/library/types.html

mport re
import types


str = 'you are'
#str = 'you are my are not they are'
RE = re.compile(r'are')

match = RE.findall(str)
if match:
    if type(match) is list:
        print match   
    else:
        print match.group()
else:
    print "No match found"
    

No comments:

Post a Comment