📌  相关文章
📜  javascript 检查字符串是否包含特殊字符 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:22.144000             🧑  作者: Mango

代码示例4
var format = /[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
//            ^                                       ^   
document.write(format.test("My@string-with(some%text)") + "
"); document.write(format.test("My string with spaces") + "
"); document.write(format.test("MyStringContainingNoSpecialChars"));