using React, I am supposed to build a form, I was given a pattern I have add to input :"+?\d{1,4}?[-.\s]?(?\d{1,3}?)?[-. \s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}" ( phone number validation) but when I enter the phone number in the form, I get error: Pattern attribute value +?\d{1,4}?[-.\s]?(?\d{1,3}?)?[-.\s]?\d{1,4 }[-.\s]?\d{1,4}[-.\s]?\d{1,9} is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /+?\d{ 1,4}?[-.\s]?(?\d{1,3}?)?[-.\s]?\d{1,4}[-.\s]?\d{ 1,4}[-.\s]?\d{1,9}/v: Invalid character in character class.
I don't know how to correct the regex. Could someone help me?
I added anchors ^ and $ did not help
"Phone number must be digits and can contain spaces, dashes, parentheses and can start with +"