📌  相关文章
📜  如何检查带有空格的特殊字符 javascript 代码示例

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

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