I'm programming a little HTML form with pattern included in a tag where a phone number must be introduced. Problem is I can't make the pattern to work as intended. Even if the desired pattern is introduced it still won't let submit the form. It's pretty obvious there's a problem in the pattern but can't figure out what (seems OK to me, but I'm no good with patterns).
The format to be accepted is XXX-XXXXXX, with X being numbers.
Here's the code in that <input> tag so far:
<input type="text" name="phonenum" id="phonenum" maxlength="10" pattern="/^\d{3}-\d{6}$/" required="required">
Same pattern is working in an alternate JavaScript validation file. I don't know what must be changed for it to work as a tag pattern.