Skip to content

Instantly share code, notes, and snippets.

@arcolife
Forked from anonymous/file1.py
Last active December 18, 2015 23:49
Show Gist options
  • Save arcolife/5864370 to your computer and use it in GitHub Desktop.
Save arcolife/5864370 to your computer and use it in GitHub Desktop.
print
def doit(text):
import re
matches=re.findall(r'\"(.+?)\"',text)
#matches1= re.findall(r'(.+?)\"',text)
# matches is now ['String 1', 'String 2', 'String3']
print matches
return ",".join(matches)
q='"Terrified, mortified, petrified, stupified by you." said John Nash, "alright"'
x = doit(q)
print x,"\n"
'''
if(doit(i)):
print "found it at ",q.index(i)
print "\nBTW, no. of tokens were",len(q)
print "Ok, tokens are: ",q
print
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment