Hi, my name is Hafsa
 
I am new to programming in Python. Basically i am working with regular _expression_ matching using Python. I have a problem with saving output from the regular _expression_ matches in a text file. Can you guide me how to save the output returned by a regular _expression_ group, into a text file? for instance for the following regular _expression_:
 
r1= re.compile("""
(?P<main>TYPE=\"PER\"\sSUBTYPE=\"Individual\")
(?P<name>.*?\<)
""",re.VERBOSE)
 
If the above regular _expression_ is searched for in a file, how can i save the output matches from the group "name" into a new text file?
 
Thanks & regards,
Hafsa


FREE pop-up blocking with the new MSN Toolbar MSN Toolbar Get it now!
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to