Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use js regularization to determine illegal characters to restrict input

Shulou Source: shulou.com Published: 2022-06-02 06:13:29 09月30日 Update

This article mainly introduces "how to use js regularization to judge illegal character restriction input". In daily operation, I believe many people have doubts about how to use js regularization to judge illegal character restriction input. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful for everyone to answer the doubt of "how to use js regularization to judge illegal character restriction input". Next, please follow the editor to study!

No input! @ # ¥%. Regular expression writing for such characters:

/ [@ #\ $%\ ^ &\ *] + / g this contains any of the above special characters. Take it! Can

Alert (! / [@ #\ $%\ ^ &\ *] + / g.test ("test") returns false means it does not contain illegal characters.

PS: with regard to regular expressions, here are two more online regular expression tools on this site for your reference (including regular generation, matching, testing, etc.):

JavaScript regular expression online testing tool: http://tools.jb51.net/regex/javascript

Regular expression online generation tool: http://tools.jb51.net/regex/create_reg

At this point, the study on "how to use js regularities to determine illegal characters to restrict input" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Regular characters input expressions restrictions learning tools online more help testing generation practical special next representatives commonly used articles methods test tools Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Tech Info MySQL Shulou Technology Microsoft