It would be very difficult to guess what the cause of '<<' and 'L' as line endings might be, without knowing what utility is generating these endings. The most common line ending differences don't involve "L" and "<<", and are particular to differences in how Windows, Linux/Unix, and Macs end their lines. But you said that all the various line ending varieties are being seen on different linux boxes, so that eliminates the Windows and Mac interference.

There isn't a universal metacharacter that matches the letter "L" and the character "<<" (sorry for my use of << instead of your nifty character; my keyboard doesn't have that key and I don't know its ordinal value or HTML entity name), while excluding all other characters. But Perl's regular expressions allow you to create your own character classes, and you can even build your own characters based on ordinal values. For example, if the '<<' character has an ordinal value of 1b (in hex. ...and it doesn't, but just for example...), you could substitute it and 'L' out of existance like this:

s/[L\x1b]//;

Dave


In reply to Re: Regex for replacing hidden character: « and L by davido
in thread Regex for replacing hidden character: « and L by neversaint

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.