For making sure at lest 10 digits are there use this regex:
/^(\D*\d){10}/
Code:
var valid = /^(\D*\d){10}/.test(str);
TESTING:
console.log(/^(\D*\d){10}/.test('123-456-7890 ext 41')); // true
console.log(/^(\D*\d){10}/.test('123-456-789')); // false
Explanation:
^ assert position at start of the string
1st Capturing group (\D*\d){10}
Quantifier: Exactly 10 times
Note: A repeated capturing group will only capture the last iteration.
Put a capturing group around the repeated group to capture all iterations or use a
non-capturing group instead if you're not interested in the data
\D* match any character that's not a digit [^0-9]
Quantifier: Between zero and unlimited times, as many times as possible
\d match a digit [0-9]