Introduction of regular Expressions (Microsoft)--4. Regular expression syntax

Source: Internet
Author: User
Tags regular expression
Regular expression syntax
A regular expression is a literal pattern consisting of ordinary characters (such as characters A through Z) and special characters (called metacharacters). This pattern describes one or more strings to be matched when looking for a text body. A regular expression is used as a template to match a character pattern with the string being searched for.
Here are some examples of regular expressions that you might encounter:
Visual Basic VBScript Matching
Scripting Edition
/^[]*$/"^[]*$" matches a blank line.
/d{2}-d{5}/"D{2}-d{5}" verifies that an ID number is made up of a 2-bit word, a
A hyphen and a 5-digit number.

/< (. *) >.*</1>/"< (. *) >.*</1>" matches an HTML tag.
The following table is a complete list of metacharacters and its behavior in the context of regular expressions:
Character description
Marks the next character as a special character, or a literal character, or a later
To a reference, or to a octal escape character. For example, ' n ' matches the character ' n '. ' '
Matches a line feed character. Sequence ' matches ' and ' ("matches" ().
^ matches the start position of the input string. If you set the RegExp object's
Multiline property, ^ also matches the position after ' or '.
$ matches the end position of the input string. If you set 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.