in reply to How can I add missing XML open tags
Personally, I'd just do this: s{<([^/>]+?)/>}{<$1></$1>}g. Only if this didn't work for some peculiar reason would I bother with a more complicated solution.
Jim
UPDATE: A possibly better alternative: s{<(\w+)/>}{<$1></$1>}ag. (Notice the /a character set modifier, which is purposeful.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How can I add missing XML open tags
by TheVend (Novice) on Dec 04, 2013 at 21:30 UTC | |
by Jim (Curate) on Dec 04, 2013 at 21:42 UTC |
In Section
Seekers of Perl Wisdom