3 ms·
Remember (?!....) is a lookaround, so it matches 0 characters. So ^(?!....)$ will only match an empty string! (Think about it). Try ^(?!....$) in
by surreal 13y ago
Remember
(?!....)
is a lookaround, so it matches 0 characters. So
^(?!....)$
will only match an empty string! (Think about it). Try
^(?!....$)
instead (the $ anchor inside the lookaround)