|
5/24 |
2007/10/22-25 [Computer/SW/Languages/Perl] UID:48415 Activity:nil |
10/22 I want a perl regex that reduces 2 or more consecutive newlines to 2 newlines. perl -pe 's/\n\n(\n*)/\n\n/gms' doesn't work, and I don't understand why. Any ideas? \_ You're reading your input one line at a time. Try this: perl -0pe 's/\n\n+/\n\n/g' --mconst \_ Are they just \n's or are they \n\r's? |