C # Regular Expression escape character introduction _c# tutorial

Source: Internet
Author: User
Tags expression engine

A regular expression (regular expression) describes a pattern of string matching that can be used to check whether a string contains a seed string, replaces a matching substring, or extracts a substring from a string that matches a condition.

Escape matching syntax:

"\" + actual character \. * + ? | () {}^ $ [] For example: \ match character "\"

\ n Match Line Wrap

\ r Match Carriage return

\ t matches horizontal tab

\v Matching Vertical tabs

\f Match page Change

\NNN matches a 8-in-system ASCII

\XNN matches a 16-in-system ASCII

\UNNNN matches 4 16-in Uniode

\c+ uppercase Match Ctrl-capital example: \cs-matching Ctrl+s

Note:

Enter double quotes in a string of type @ "" to write two double quotes, such as:

If you want to say: James "Wu"

To write: @ "James" "Wu" ""

PS: the backslash (\) in the regular expression indicates one of the following values:

The followed character is a special character, as shown in the following section table. For example, \b is an anchor point that indicates that a regular expression matches the start of a word boundary, \ t represents a tab, and \x020 represents space.

Characters that should be interpreted as not escaping language constructs should be interpreted literally. For example, a brace ({) begins to define a qualifier, and a backslash followed by a brace (\{) indicates that the regular expression engine should match the braces. Similarly, a single backslash marks the start of the escaped language construct, and two backslashes (\ \) indicate that the regular expression engine should match the backslash.

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.