Why does this regex return null
:
"abcabc1Z".match(/^(?=w{3,6})(?=.*d)(?=.*Z)$/)
That returns null
but this:
"abcabc1Z".match(/^(?=w{3,6})(?=.*d)(?=.*Z)/)
does not return null
(the difference the second pattern does not include $
).
Why does the first one return null
? Shouldn’t both return the matched string?