dsayars has asked for the wisdom of the Perl Monks concerning the following question:
I'm using ActivePerl in Windows on a file that contains \r\n carriage returns, but but I can't match them in my Perl regex. Neither of these expressions works:
<cp IX='1'\/>([A-Z][A-Z][A-Z])(.*?)\r\n> <cp IX='1'\/>([A-Z][A-Z][A-Z])(.*?)\x0d\x0aBoth expressions work in editpad pro. I ended up having to replace every instance or "\r\" with with "crlf" and use this expression:
cp IX='1'\/>([A-Z][A-Z][A-Z])(.*?)crlfIs Perl not supposed to recognize both "\r\n" and "\x0d\x0a" as carriage returns? They are definitely present in the file or I couldn't have found and replaced them with "crlf".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ActivePerl won't match carriage returns (binmode)
by tye (Sage) on Nov 01, 2011 at 22:12 UTC | |
|
Re: ActivePerl won't match carriage returns
by GrandFather (Saint) on Nov 02, 2011 at 00:26 UTC | |
|
Re: ActivePerl won't match carriage returns
by SuicideJunkie (Vicar) on Nov 01, 2011 at 22:05 UTC | |
by dsayars (Initiate) on Nov 01, 2011 at 22:44 UTC | |
by Anonymous Monk on Nov 01, 2011 at 22:47 UTC |