EV: Notepad++ Regular Express syntax

1. Back Reference
Use \1 for the first match.
Example: Replace "(SB)" in string "SA SB SC" with "\1X", you will got "SA SBX SC".
Example: Replace "(.*) = (.*);" with "\2 = \1;", you will got "txtName.Text = Category.Name;" from "Category.Name = txtName.Text;".
 
2. New Line
Use \r\n for new line.
Example:
    1). Replace "\r\n" in a text block with ", " will join multiple lines into one.
    2). Replace "\r\n" in a text block with "");\r\ns.AppendLine("" will wrap each line into s.AppendLine("line content");

 

posted on 2013-12-26 21:19  weihongji  阅读(343)  评论(0编辑  收藏  举报

导航