Ankur Marwaha
Ankur Marwaha

Reputation: 1885

^A/m in regex is not working as mdn suggests

^ ----> 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. Here's a picture for the same

Upvotes: 0

Views: 88

Answers (1)

Duc Filan
Duc Filan

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:

Here

P/s:

should for all the multiline beginning

So you need global and multiline flags.

Upvotes: 1

Related Questions