Negative Lookahead for Regex -
what difference between:
^(?!.*baa)[abc]*$
and
^(?!baa)[abc]*$
what role of .*
. know means character 0 or more times why second 1 capture strings cccaabaa
should discarded?
the difference between them is:
^(?!.*baa)
requiresbaa
not anywhere in input^(?!baa)
requiresbaa
not @ the start of input
the .*
allows between start ^
, baa
.
Comments
Post a Comment