Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print all adverbs is a string regex
11-10-2009, 11:03 AM
Post: #1
print all adverbs is a string regex
Code:
import re
#add text to a variable  
text = "He was carefully disguised but captured quickly by police."
#find all words that end with ly from text variable
re.findall(r"\w+ly", text)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: