How to test a regex

var stringWithNumbers = 'alo1337'; var stringWithoutNumbers = 'alo'; var test1 = /\d/.test(stringWithNumbers); var test2 = /\d/.test(stringWithoutNumbers); console.log(test1,test2);

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.