[thelist] perl regexp/XML question

Anthony Baratta Anthony at Baratta.com
Thu, 06 Jan 2000 14:07:46 -0800


Jeremy Ashcraft wrote:
> 
> I need the help of a perl jockey greaer than I.  I'm writing a function
> to parse the key-value pairs from the attributes in an XML tag(eg <tag
> attr1="val1" attr2="val2" attr3="val3" ...>).  The way I'm doing it now

Assuming your example: attr1="val1" attr2="val2" attr3="val3"

Why not split on '" ' then split on '=', don't forget to remove the leading " from
the value. This would allow you to have '= "' and '="' and not worry about which
format.

-- 
Anthony Baratta
President
KeyBoard Jockeys
                    South Park Speaks Version 3 is here!!!
                       http://www.baratta.com/southpark
                              Powered by Tsunami