Koos Pol said:
No it does not. In the described problem the EOL is simply irrelevant.
print "12345" =~ /^.*$/ ? 1 : 0;
print "123\r\n" =~ /^.*$/ ? 1 : 0;
print "12345 " =~ /./ ? 1 : 0; # or even this
print "123\r\n" =~ /./ ? 1 : 0; #
prints 1111
Insofar you are right. But the following example for Perl
5.8.3 shows that "\r\n" is not always matched by the ".*":
print "12345" =~ /^.*$/ ? 1 : 0;
print "123\r\n5" =~ /^.*$/ ? 1 : 0;
It prints »10« here. It seems as if there was a special rule
for a trailing "\r\n", that does not apply anymore when "\r\n"
appears in the middle of a text.
What I sometimes use to match it, is:
print "12345" =~ /^[^\001]*$/ ? 1 : 0;
print "123\r\n5" =~ /^[^\001]*$/ ? 1 : 0;
This could be used in Java as well, I assume.