I want to ignore square brackets when using javascript regex

前端 未结 4 1369
我在风中等你
我在风中等你 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:49

    I'm not sure what you want but I don't think your current regexp does what you think it does:

    It tries to find one character is not A-z0-9 "!&,'\- (^ means not).

    Also, I'm not even sure what A-z matches. It's either a-z or A-Z.

    So your current regexp matches strings like "." and "Hi." but not "Hi"

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题