in reply to how to use matching operator on newlines

I have a unix-formatted double spaced file, so each line of text is followed by 2 linefeeds, which is \n, right?

Theoretically, yes, but this assumes much. Among other things, we are assuming that you are running this regular expression on a system where \n corresponds to a single linefeed character, which is not universally the case. (You say the file is from a Unix system, but you don't say if you are running Perl on a Unix system...) It is also worth looking at the text file in a hex editor, to verify that it has the same kind of line endings you think it has.


Sanity? Oh, yeah, I've got all kinds of sanity. In fact, I've developed whole new kinds of sanity. You can just call me "Mister Sanity". Why, I've got so much sanity it's driving me crazy.
  • Comment on Re: how to use matching operator on newlines