I have a Perl script that uses an XML file on Linux, and sometimes in some node values there is CRLF (Hex 0D0A, Dos new lines).
The system that creates the XML file writes everything as a single line, and it looks like it sometimes decides that it is too long and writes the CRLF to one of the data elements. Unfortunately, I can not do anything with the providing system.
I just need to remove them from the string before processing it.
I tried all kinds of regular expression replacements using perl char classes, hexadecimal values, all kinds and nothing seems to work.
I even run the input file through dos2unix before processing, and I still cannot get rid of erroneous characters.
Does anyone have any ideas?
Many thanks,
regex perl
Hehasmoments
source share