Created
June 25, 2013 13:03
-
-
Save anonymous/5858266 to your computer and use it in GitHub Desktop.
Pasted from IPython
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
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