console.log(/\d{10}/.test("(1234567890)");
why does this evaluate to true even when there’s a special character “(” in there. My regex is only for 10 digits?
console.log(/\d{10}/.test("(1234567890)");
why does this evaluate to true even when there’s a special character “(” in there. My regex is only for 10 digits?
there are ten digits in your string
a regular expression tests true if the string contains a substring that matches the regex pattern
if you want for a whole string to be matched you need to add something to your pattern
ah. Got it . Thanks!!!
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.