in reply to Re^2: sequential substitutions
in thread sequential substitutions
I certainly see your point about not trying to parse arbitrary HTML or XML with regular expressions, but in this case, I am looking for a specific tag with numeric values that have already been sanitized by another program.
Can you trust the source of the XML to never change (whitspace, attributes, CDATA, namespaces, comments, etc.), and can you trust the program that's doing the sanitization to never change its output either? What's wrong with installing modules, especially such helpful ones? (Yes, even you can use CPAN.)
Sure, it's possible to adapt the regexes shown by the others to this purpose to work on the sample data you've showed, but I personally am not going to jump down the rabbit hole of parsing XML with regexes in this case :-)
Do you know of an HTML "cleanup" program (or module) that will take (mostly arbitrary) HTML and output one tag per line properly indented?
Searching for "html tidy" on Google and CPAN shows lots of different options (I haven't used any of them, so I can't give you recommendations). Plus, I wonder why you're asking about such a program, if you said above your XML is already sanitized? ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: sequential substitutions
by Anonymous Monk on Aug 03, 2018 at 11:46 UTC | |
by haukex (Archbishop) on Aug 03, 2018 at 13:07 UTC |