Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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'
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #regex
ADD COMMENT
Topic
Name
1+6 =