Processing XML with Regular Expressions : XML Parse : XML PYTHON examples


PYTHON examples » XML » XML Parse »

 

Processing XML with Regular Expressions


 

import sys, re

pat = r'<title>(.*?)</title>'
data = open(sys.argv[1]).read()

m = re.search(pat,data)
if m:
   print m.group(1)

   
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo XML
» XML Parse