Regular Expressions: Positive and Negative Lookahead***

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/regular-expressions/positive-and-negative-lookahead
What is the problem with this? I try it with Regexr and I match every test.

^[A-Z](?=\w{5,})(?=\D*\d)$/i
  1. Your regex should use two positive lookaheads.

  2. Don’t use the g flag with test method (you can look at the documentation on the why)

1 Like