My regular expressions

Source: Internet
Author: User

1

At least 8 characters

". {8 ,}"

2

URL

Http: // ([\ w-] + \.) + [\ w-] + (/[\ w -./? % & =] *)?



URL (2)

^ [A-zA-z] +: // (\ w + (-\ w + )*)(\\. (\ w + (-\ w + )*))*(\\? \ S *)? $

3

Email

\ W + ([-+.] \ w +) * @ \ w + ([-.] \ w + )*\. \ w + ([-.] \ w + )*



Email (2)

^ [\ W \.-] + @ [\ w-] + \. [\ w \.-] + $



Email (3)

^ [\ W-] + (\\. [\ w-] +) * @ [\ w-] + (\\. [\ w-] +) + $

4

Non-negative integer (positive integer + 0)

^ \ D + $

5

Positive Integer

^ [0-9] * [1-9] [0-9] * $

6

Non-positive integer (negative integer + 0)

^ (-\ D +) | (0 +) $

7

Negative integer

^-[0-9] * [1-9] [0-9] * $

8

Integer

^ -? \ D + $

9

Non-negative floating point number (Positive floating point number + 0)

^ \ D + (\. \ d + )? $

10

Positive floating point number

^ ([0-9] + \\. [0-9] * [1-9] [0-9] *) | ([0-9] * [1-9] [0-9] * \. [0-9] +) | ([0-9] * [1-9] [0-9] *) $

11

Non-Positive floating point number (negative floating point number + 0)

^ (-\ D + (\. \ d + )?) | (0 + (\. 0 + )?)) $

12

Negative floating point number

^ (-([0-9] + \\. [0-9] * [1-9] [0-9] *) | ([0-9] * [1-9] [0-9] * \. [0-9] +) | ([0-9] * [1-9] [0-9] *) $

13

Floating Point Number

^ (-? \ D +) (\. \ d + )? $

14

String consisting of 26 English letters

^ [A-Za-z] + $

15

A string consisting of 26 uppercase letters.

^ [A-Z] + $

16

A string consisting of 26 lower-case letters.

^ [A-z] + $

17

String consisting of digits and 26 English letters

^ [A-Za-z0-9] + $

18

String consisting of digits, 26 English letters, or underscores

^ \ W + $

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.