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:

  1. ^(?!.*baa) requires baa not anywhere in input
  2. ^(?!baa) requires baa not @ the start of input

the .* allows between start ^ , baa.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -