I create a regular expression to validate a phone number, but it doesn't work.
<form>
<label for="phone">Phone number:</label>
<input type="tel" name="phone" id="phone" required
pattern="^\d{10}$|^\d{3}([\s-\.])\d{3}\1\d{4}$">
<button>Submit comment</button>
</form>
I use "an123456" to test, it's not a phone number, but it passed. I changed the "\s" in the pattern to " ", the regular expression worked correctly. So what's wrong with the "\s"?