Input uses pattern to verify that the URL reported an error and a regular error

the browser will report an error when using the following rules.

<input pattern="^https?:\/\/([a-zA-Z0-9\-]+\.)+([a-zA-Z]{2,5})([\/\?-sharp][a-zA-Z0-9`~!@-sharp%&_=;\$\^\*\(\)\-\+\{\}\[\]\:\,\.\?\/\|]*)?$"
 onblur="inspectValidity(this)" name="url" type="text" required />

``
:

> Pattern attribute value ^https?:\/\/([a-zA-Z0-9\-]+\.)+([a-zA-Z]{2,5})([\/\?-sharp][a-zA-Z0-9`~!@-sharp%&_=;\$\^\*\(\)\-\+\{\}\[\]\:\,\.\?\/\|]*)?$ is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /^https?:\/\/([a-zA-Z0-9\-]+\.)+([a-zA-Z]{2,5})([\/\?-sharp][a-zA-Z0-9`~!@-sharp%&_=;\$\^\*\(\)\-\+\{\}\[\]\:\,\.\?\/\|]*)?$/: Invalid escape




< input type= "text" pattern= "[1-9] d {5} (?! d)" onblur= "inspectValidity (this)" name= "code" required / >



 

is there a mistake in escaping?,:, doesn't need to be escaped.

Menu