Skip to content

Instantly share code, notes, and snippets.

Created June 25, 2013 13:03
Show Gist options
  • Save anonymous/5858266 to your computer and use it in GitHub Desktop.
Save anonymous/5858266 to your computer and use it in GitHub Desktop.
Pasted from IPython
def doit(text):
import re
matches=re.findall(r'\"(.+?)\"',text)
# matches is now ['String 1', 'String 2', 'String3']
return ",".join(matches)
doit(q)
q=q.split()
q
for i in q:
print doit(i)
for i in q:
if(doit(i)):
print "found it at ",q.index(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment