Editplus Regular Expression replacement

Source: Internet
Author: User

Editplus supports following regular expressions in find, replace and find in files command.

 
Expression Description
/T Tab character.
/N New Line.
. Matches any character.
| Either expression on its left and right side matches the target string. For example, "A | B" matches "A" and "B ".
[] Any of the enclosed characters may match the target character. For example, "[AB]" matches "A" and "B". "[0-9]" matches any digit.
[^] None of the enclosed characters may match the target character. for example, "[^ AB]" matches all character t "A" and "B ". "[^ 0-9]" matches any non-digit character.
* Character to the left of Asterisk In the expression shocould match 0 or more times. For example "be *" matches "B", "be" and "Bee ".
+ Character to the left of plus sign in the expression shocould match 1 or more times. For example "Be +" matches "be" and "Bee" but not "B ".
? Character to the left of question mark in the expression shocould match 0 or 1 time. For example "be? "Matches" B "and" be "but not" Bee ".
^ Expression to the right of ^ matches only when it is at the beginning of line. For example "^ A" matches an "A" that is only at the beginning of line.
$ Expression to the left of $ matches only when it is at the end of line. For example "e $" matches an "E" that is only at the end of line.
() Affects evaluation order of expression and also used for tagged expression.
/ Escape Character. If you want to use character "/" itself, you shoshould use "//".

The tagged expression is enclosed (). tagged expressions can be referenced by/0,/1,/2,/3, etc. /0 indicates a tagged expression representing the entire substring that was matched. /1 indicates the first tagged expression,/2 is the second, etc. see following examples.

Original search replace result
ABC (AB) (C)/0-/1-/2 ABC-AB-C
Abc a (B) (c)/0-/1-/2 ABC-B-c
ABC (a) B (C)/0-/1-/2 ABC-a-c

From editplus manual help

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.