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.
In reply to Re: how to use matching operator on newlines
by jonadab
in thread how to use matching operator on newlines
by redss
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |