loading
open in
index.js
1
2
3
4
5
6
7
8
9
let testRegex = /\d{2}-?\d{3}/;
let testString = '30-456'
console.log(testRegex.test(testString));

let testString2 = '30456'
console.log(testRegex.test(testString2));

let testString3 = '30--456'
console.log(testRegex.test(testString3));
node v10.15.2 linux/amd64