Answers for "regex not something"

2

regex not something

// You can use (?!...) like the example below

let names = ['JOAO', 'JOHN', 'JOANA', 'JOABE'];
for(let n of names)
{
  	/(JO)(?!A)/.test(n);
	// only true on 'JOHN'
}
Posted by: Guest on February-22-2021
0

regex not a value

^((?!hede).)*$
Posted by: Guest on May-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language