Regular expression Replace replace operation

Source: Internet
Author: User
Tags regular expression

Replace substitution operation
Replaces the string to which it is matched.


--------------------------------------------------------------------------------

Description
$ ~ $999

Represents the content captured by a capturing group. If the capturing group number is greater than the maximum capturing group number in the expression, then DEELX reduces the number of digits so that the capturing group number is less than or equal to the maximum number, while the remaining digits are treated as string constants.

Example:

The current maximum capturing group number is 20, so specifying "$999" will be treated as "$" + "99", and specifying "$" to represent the 15th capturing group will be replaced. If you originally wanted to use "5" as a string constant ("$" + "5"), you could have used $0015 to represent a maximum of 3-bit 10-digit digits. DEELX


--------------------------------------------------------------------------------

${name}

Represents the content captured by the specified named grouping.


--------------------------------------------------------------------------------

$$

Represents a $ symbol.


--------------------------------------------------------------------------------

$&

Represents each match to the content.


--------------------------------------------------------------------------------

$`

Represents the string that precedes the content in the original string. $ ' Medium ' is the symbol below the top left corner of the keyboard.


--------------------------------------------------------------------------------

$'

A string that represents the content that is matched to in the original string. The $ ' Medium ' symbol is a single quote.


--------------------------------------------------------------------------------

$+

Represents the group with the largest number in all "have captures" groupings.

For example: "aaa (b +) |CCC (b +)" When matching "aaabbb", although the largest group is the 2nd group, but the largest "have capture" is the 1th group, at this time the $+ represents $.


--------------------------------------------------------------------------------

$_

Represents the entire string being replaced. "_" is an underscore.

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.