Regular Expression Analysis in jQuery

Source: Internet
Author: User

QuickExpr =/^ (? : [^ <] * (<[\ W \ W] +>) [^>] * $ | # ([\ w \-] +) $ )/
(? :...) Indicates a non-capturing type.

[^ <] Indicates that it starts with "<" and contains 0 or more '<' parentheses

(<[\ W \ W] +>) indicates a capture type. It starts with '<>' and contains one or more characters.

$ Indicates the end of a character.

(# ([\ W \-] +) indicates a capture type, which is composed of '#' and string, number, _, and -.

Rnotwhite =/\ S/
\ S indicates a symbol other than a blank character

TrimLeft =/^ \ s +/trimRight =/\ s + $/
Left and right sides. S is a blank character. ^ The prefix indicates the start of the string, and the $ suffix indicates the end of the string.

Rdigit =/\ d/
Indicates a number.

RsingleTag =/^ <(\ w +) \ s * \/?> (? : <\/\ 1> )? $/
^ <(\ W +) \ s * \/?>
Start with '<', contains one to multiple characters, and ends with 0 to multiple white spaces, 0 or '/' and '>,

(? : <\/\ 1> )? $

Indicates that the end of the first capture type exists or does not exist.

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.