Introduction to regular expressions (Microsoft) -- 4. Regular expression syntax

Source: Internet
Author: User

Regular expression syntax
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 expression is used as a template to match a character pattern with the searched string.
Here are some examples of regular expressions that may be encountered:
Visual Basic VBScript matching
Scripting Edition
/^ [] * $/"^ [] * $" Matches a blank row.
/D {2}-d {5}/"d {2}-d {5}" verify whether an ID number is composed of two characters, one
And a five-digit combination.

/<(. *)>. * </1>/"<(. *)>. * </1>" matches an HTML Tag.
The following table shows a complete list of metacharacters and their behaviors in the context of a regular expression:
Character Description
Mark the next character as a special character, a literal character, or a suffix
A quote, or an octal escape character. For example, 'n' matches the character "n ". ''
Match A linefeed. The sequence ''matches" "and" ("matches "(".
^ Matches the start position of the input string. If the RegExp object's
The Multiline attribute. ^ also matches the location after ''or.
$ Matches the end position of the input string. If the RegExp object's

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.