The input box filters non-numeric js Code, and the input box js Code
HTML:Copy codeThe Code is as follows:
JS:
Window. onload = function (e) {var text = document. getElementById ("only"), pattern =/\ d/, // pattern matches the alphanumeric key
Regular
by Jim Hollenhorst Cold fish
Have you ever thought about what a regular expression is and how you can get a basic understanding of it quickly? My goal is to get you started in 30 minutes and have a basic understanding of regular expressions.
This article mainly introduces js characters used to filter non-numeric characters in the input box. It is very simple but practical. For more information, see HTML:
The Code is as follows:
JS:
Window. onload = function (e) {var text = document.
First, the entrance method./*tmpl: Template text C: User-defined Configuration def: Define data to be executed at compile time */function (Tmpl, C, def) {}Then enter the first inning codec = C | | Dot.templatesettings;Dot.templatesettings contains
Special characters in regular expressions
Character implication
\ As a turn, that is, the characters usually after "\" are not interpreted in the original sense, such as the/b/matching character "B", when B is preceded by a backslash/\b/, to
Metacharacters [and] are used to define a character set combination, which means that they must match one of the characters in the set. W: any letter, digit (case-sensitive) or underscore (equivalent to [a-zA-Z0-9 _]), can only match a single
Advanced | skills | regular
ObjectiveRegular Expressions (regular expression, the following is called by re to the younger brother has always been a god-dense zone, see some of the network on the big, simple with re on the decision to solve some of
What is re?
You must have used all the characters "*" in the file search, for example, to find all the word files in the Windows directory, you might use the "*.doc" method to do the lookup, because "*" represents any character. The RE is doing
A Brief introduction:In essence, a regular expression (or RE) is a small, highly specialized programming language,(in Python) it is embedded in Python and is implemented through the RE module. The regular expression pattern isCompiled into a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.