I am sure there is an easier way to do this for example using an xml parser but here is one way you could pull it off with regular expressions M=re.search("<save>.*</save>",myStr) newStr=myStr[m.start()+6:m.end()-7] This will return the save part in newStr. Not that I add and subtract the length of the tag in the start and end because those are the positions of the match and include the tags. Ken -----Original Message----- From: programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Alex Hall Sent: Sunday, February 14, 2010 3:34 PM To: Blind Programming List Subject: regexp/python Hi all, I am trying to write a regexp in python to look at a file (as a big string) and erase all text before a certain word, then erase all text after a second keyword. This sentence: All this should be deleted <save>except for this</save>, so delete it! would be turned into except for this I am not sure how to go about this, though. If I were using a batch-like syntax, my string to match might be *<save> and then </save>* but the star character is used to repeat a regexp op, not as a wildcard in the text itself. Am I just misunderstanding something here? Thanks. Have a great day, Alex (msg sent from PC) Email: mehgcap@xxxxxxxxx __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind