] regex - how to match the last
CR+LF
BRN == Bill Ricker N1VUX [EMAIL PROTECTED] writes:
BRN Or, my favorite,
BRN chop while /\s$/; ### Omit all trailing
whitespace,
BRN ###
including whole blank lines
I have been trying to craft a regex to eliminate the last CRLF in the
following string but without success... Hmmm my Perl is getting rusty :-(
[EMAIL PROTECTED]@
FRC\cM\cJLAXAA\cM\cJ001-95011243-10026822\cM\cJWBL/BLQ/T2/K37.0/NEW SPARE
PARTS\cM\cJARR/AA100/22JUN\cM\cJSHP/BMC AIR
I have been trying to craft a regex to eliminate the last CRLF in the
... string [which] has many CRLF sequences but I need the last set dropped.
1. Religious affairs
Looks like you're in paragraph ($/=) or slurp ($/=undef) mode on Unix but
reading DOS files. Or you're using RAW/Binary mode.
Dear Bill,
Or, my favorite,
chop while /\s$/; ### Omit all trailing whitespace,
### including whole blank lines at the end
### and last CRLF or NL or whatever is holy
IMHO s/\s*$// is faster for the author's brain, the
chop while /\s$/; ### Omit all trailing whitespace,
IMHO s/\s*$// is faster for the author's brain, the
reader's brain and the CPU.
That does bring us back full circle to using Substitute doesn't it!
:-)
-- Bill
___
Boston-pm mailing