I want to ignore square brackets when using javascript regex

前端 未结 4 1499
我在风中等你
我在风中等你 2021-01-13 13:08

I am using javascript regex to do some data validation and specify the characters that i want to accept (I want to accept any alphanumeric characters, spaces and the followi

4条回答
  •  孤独总比滥情好
    2021-01-13 13:51

    The reason is that you are using A-z rather than A-Za-z. The ascii range between Z (0x5a) and a (0x61) includes the square brackets, the caret, backquote, and underscore.

提交回复
热议问题