Only one number can be entered
Expression ^ \ D $The description matches a number.Matching example 0, 1, 2, 3Example of Mismatch
Only n numbers can be entered
Expression ^ \ D {n} $ for example ^ \ D {8} $The description matches 8 numbers.Matching
The following describes the verification functions and expressions used to verify the control using regularexpressionvalidator:
Only numbers can be entered: "^ [0-9] * $"Only n digits can be entered: "^ d {n} $" matches n digits "/d {n }".You can
Common Regular Expressions/Corresponding escape characters/syntax
Only numbers are allowed: "^ [0-9] * $ ".
Only n digits can be entered: "^/d {n} $ ".
You can only enter at least N digits: "^/d {n,} $ ".
Only M ~ can be input ~ N-digit :. "^/D {m,
Only one number can be entered
Expression ^ \ D $The description matches a number.Matching example 0, 1, 2, 3Example of Mismatch
Only n numbers can be entered
Expression ^ \ D {n} $ for example ^ \ D {8} $The description matches 8
JS judgment can only be a number or a decimal point
1. Only numbers can be entered in the text boxCode(Decimal point cannot be entered)
2. Only numbers can be entered, and decimal points can be entered.
3. Number and decimal point
1. Only numbers can be entered in the text boxCode(Decimal point cannot be entered)
2. Only numbers can be entered, and decimal points can be entered.
3. Only letters and Chinese characters can be entered
4. Only English letters and numbers
A regular expression is a text mode consisting of common characters (such as characters a to z) and special characters (such as metacharacters. This mode describes one or more strings to be matched when searching the text subject. A regular
Only numbers are allowed: "^ [0-9] * $ ".Only n digits can be entered: "^ \ d {n} $ ".You can only enter at least n digits: "^ \ d {n,} $ ".Only m ~ can be input ~ N-digit :. "^ \ D {m, n} $"Only numbers starting with zero and non-zero can be
JS verification function call method and note:
1. Set onsubmit = "return test ()" for the form and submit it with .
2. // call function verification directly when you press the mouse
3. // pass in your own value for verification, test (this) //
??This is from the Internet, the collection of spare, where to use can save a lot of time Oh! Only numbers can be entered: "^[0-9]*$".Only n digits can be entered: "^\d{n}$".Only numbers with at least n digits can be entered: "^\d{n,}$".Only m~n
integer or decimal: ^[0-9]+\. {0,1} [0-9] {0,2}$only numbers can be entered: "^[0-9]*$". only n digits can be entered: "^\d{n}$". only numbers with at least n digits can be entered: "^\d{n,}$". You can enter only the digits of the m~n bit:. "^\d{m,n}
Regular expressions, also known as regular expressions, in English named regular expression, are often abbreviated as regex, RegExp, or re in Code, and are a concept of computer science. Regular tables are often used to retrieve and replace text
This article mainly introduces Chinese translation and examples of phpctype functions. there are multiple examples of related functions. if you need them, refer to the PHP Ctype extension, which is a built-in extension starting with PHP4.2. note,
1. The dotted box when the cancel button is pressed
Add the attribute value hidefocus or hidefocus = true in input.
2. Read-only text box contentAdd the attribute value readonly in input.
3. prevent text files from being cleared (style
CopyCode The Code is as follows:
Width = "80px" onafterpaste = "If (isnan (value) Execcommand ('undo ')">
In fact, the server control can also add events such as onkeydown and up.
In this way, only decimals and numbers can be entered.
In.
Suddenly found PHPCtype function, Ctype extension is PHP4.2 built-in extension: ctype_alnum & amp; mdash; check the string contains only numbers or letters, equivalent to regular [A-Za-z0-9]. cty
Suddenly we found that the PHP Ctype function, the
Regular expressions are also called regular expressions, and sometimes we will call it "Mars text", because when you write, then go to see, often will not understand, although it is so, but because it has a powerful function, so become our essential
With the application and development of the Internet, regular expressions play an increasingly important role in application systems! They are often the prosecutors of a system and a website, and play an intuitive and important role in information
JS judgment can only be a number or a decimal point (extracted from other materials, posted here only for personal convenience)1. Only numbers (excluding decimal points) can be entered in the text box)2. Only numbers and decimal points can be
Integer or decimal: ^[0-9]+\. {0,1} [0-9] {0,2}$Only numbers can be entered: "^[0-9]*$".Only n digits can be entered: "^\d{n}$".Only numbers with at least n digits can be entered: "^\d{n,}$".You can enter only the digits of the m~n bit:.
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.