Thanks for the detailed explanation. That was exactly what I was asking about: exact parts of both regexes which work incorrectly.
.\n was intended to match all characters, including newline character ( since with //m modifier '.' doesn't match newline ). But I see, that within square brackets the dot must be escaped. So, if all characters are expressed as \s\S, the regex now works:Thanks!my $d = $s =~ s/[\s\S]*^$m *: (.*)$(?:[\s\S]*)/$1/rm;
In reply to Re^2: Why multiline regex doesn't work?
by nbd
in thread Why multiline regex doesn't work?
by nbd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |