The .* does not match a newline character, and $ is optional. Perhaps you also want the /s modifier (perlre):(?m-isx:^.*$) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?m-isx: group, but do not capture (with ^ and $ matching start and end of line) (case- sensitive) (with . not matching \n) (matching whitespace and # normally): ---------------------------------------------------------------------- ^ the beginning of a "line" ---------------------------------------------------------------------- .* any character except \n (0 or more times (matching the most amount possible)) ---------------------------------------------------------------------- $ before an optional \n, and the end of a "line" ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------
use warnings; use strict; "AAC\nGTT\n" =~ /^.*$/ms; print $&; __END__ AAC GTT
In reply to Re: /m pattern matching modifier
by toolic
in thread /m pattern matching modifier
by tandx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |