in reply to Regex bug? matching multiple newline with /m
$ is a zero-width match, it does not consume a \n;
[rick@ry ~]$ perl -e 'use strict; printf "%s\n", "ab\nab\n" =~ /^ab$ab +$/m' Global symbol "$ab" requires explicit package name (did you forget to +declare "my $ab"?) at -e line 1. Execution of -e aborted due to compilation errors. [rick@ry ~]$
Try adding the 'use strict;' to your other examples to see what they are really doing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex bug? matching multiple newline with /m
by NERDVANA (Priest) on Aug 09, 2021 at 10:41 UTC | |
by AnomalousMonk (Archbishop) on Aug 09, 2021 at 14:51 UTC | |
by BillKSmith (Monsignor) on Aug 14, 2021 at 15:23 UTC |