From: Peter Hickman Date: 2013-03-13T20:45:23+09:00 Subject: Re: ideas on how to determine tag --047d7b66fc19e5cc7404d7ccf0ab Content-Type: text/plain; charset=ISO-8859-1 Just for the record the regex you gave will have difficulty with the following It will give the node name as 'fred ref="other"' because you are assuming that the id attribute is the first attribute after the element name, which may not be the case. Of course you can make the regex handle that too. But then the regex becomes even less readable. --047d7b66fc19e5cc7404d7ccf0ab Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Just for the record the regex you gave will have difficult= y with the following

<fred ref=3D"other&quo= t; id=3D"12">

It will giv= e the node name as 'fred ref=3D"other"' because you are a= ssuming that the id attribute is the first attribute after the element name= , which may not be the case. Of course you can make the regex handle that t= oo. But then the regex becomes even less readable.
--047d7b66fc19e5cc7404d7ccf0ab--