Firefox error: Unable to check input because the pattern is not a valid regexp: invalid identity escape in regular expression

后端 未结 1 1114
小蘑菇
小蘑菇 2020-12-03 21:45

I\'m using regex pattern matching for HTML5 form validation. The latest version of Firefox gives me an error. I only started seeing this in Firefox 46. I don\'t think th

相关标签:
1条回答
  • 2020-12-03 22:25

    This is due to the following change: Bug 1227906 - HTML pattern attribute should set u flag for regular expressions

    As someone has already said, you don't have to escape those characters. Just use:

    <input pattern="[@%]">
    
    0 讨论(0)
提交回复
热议问题