Javascript regular expression commas can be verified

use possible notation: [!-sharp $% & = +-/ * ~ ^ | @. _?]

var newPassword =",";
var reg = /^[a-zA-Z0-9!-sharp$%&=+-/*~^|@._?]+$/;
...
reg.test(newPassword) //true

should not be a comma either.
wait a minute
what"s wrong

Sep.16,2021

clipboard.png

'+' - '/'charCode:


','.charCodeAt()charCode44testtrue


clipboard.png

[] -^


- +/

- ^
clipboard.png

^[a-zA-Z0-9!-sharp$%&=+-/*~^|@._?]+$:

clipboard.png


clipboard.png


Special symbols need to be escaped

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b28c-2afb4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b28c-2afb4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?