and<heading level=2> Introduction to Arguments</heading>
And I would like to integrate the "level" attribute into the <heading> tag, so that the first would become<heading> <index primary-key="procedures" secondary-key="definition, rest ar +guments in"/> <index primary-key="rest arguments" secondary-key="specifying, in +procedure definition"/> level=3, Specifying Rest Arguments in a Procedure Definition</heading>
and the second would become<heading2> Introduction to Arguments</heading2>
To do this I've written a regex which, unfortunately, fails to work. Here's my regex:<heading3> <index primary-key="procedures" secondary-key="definition, rest ar +guments in"/> <index primary-key="rest arguments" secondary-key="specifying, in +procedure definition"/> Specifying Rest Arguments in a Procedure Definition</heading3>
Any hints on where my logic goes astray? Thanks for any and all info, sorry to bother everyone with such a simple question.$text =~ s/<heading([^(<\/heading>)]*?)level=(.{1})([^(<\/heading>)]*? +)<\/heading>/<heading$2>$1$3<\/heading$2>/gsix;
In reply to Regex for XML attributes... by tshabet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |