javascript - How to know if a string contains special characters?
滿天的星座
滿天的星座 2017-05-19 10:38:52
0
1
554

For example: var regVal = '\w ';

How to know if it contains a backslash?

滿天的星座
滿天的星座

reply all(1)
迷茫
/\/.test(regVal);

In addition, your regVal assignment may not achieve the purpose. The backslashes in the string literal must be escaped:

var regVal = "\w+";
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template