Reputation: 1885
^ ----> Matches beginning of input. If the multiline flag is set to true, also matches immediately after a line break character.
For example, /^A/ does not match the "A" in "an A", but does match the first "A" in "An A".
Above is documented in mdn - under this link
Adding /m flag at the end of the regex doesn't work, as it should for all the multiline beginning.
Upvotes: 0
Views: 88
Reputation: 7157
You are using regexr.com
, choosing a flag is not just typing it directly with a slash. You should choose your flag here:
P/s:
should for all the multiline beginning
So you need global and multiline flags.
Upvotes: 1