Prints:$text_1 = "abc\nd"; $text_1 =~ m/.*(.|\n)/; print("----------\n>" . $1 . "<\n");
Should print d---------- > <
In reply to Re^2: How to match last character of string, even if it happens to be a newline?
by Allasso
in thread How to match last character of string, even if it happens to be a newline?
by Allasso
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |