I would split on /\r\n?/ instead. That avoids removing blank lines.
Update: In answer to graff's reply, /\r\n?|\n/ will work on all three platforms. I would probably just fix the original files with something based on the first regex I gave though. Better to standardize the files right off the bat. Customizing all sorts of code to deal with all three file types will get old real quick.
-sauoq "My two cents aren't worth a dime.";
In reply to Re: Handling Mac, Unix, Win/DOS newlines at readtime...
by sauoq
in thread Handling Mac, Unix, Win/DOS newlines at readtime...
by strredwolf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |