It works because . does not match newlines by default.i think betterworld knows this =)
update:
"\n" =~ /\n.*\z/; # matches "\n" =~ /.*\z/; # doesn't match. huh? "\n" =~ /[^\n]*\z/; # matches. ??
In reply to Re^2: Strange regex to test for newlines: /.*\z/
by tinita
in thread Strange regex to test for newlines: /.*\z/
by betterworld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |