EditPlus中的正則表達式中英文詳解(附常用實例)
/t Tab character.tab符號
/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 EXCEPT “a” and “b”.“[^0-9]” matches any non-digit character.用[]括起來的都“不匹配”
* Character to the left of asterisk in the expression should match 0 or more times.For example “be*” matches “b”, “be” and “bee”.“*”號左邊的那個字符匹配0次或者更多次
+ Character to the left of plus sign in the expression should match 1 or more times.For example “be+” matches “be” and “bee” but not “b”.“*”號左邊的那個字符匹配1次或者更多次
? Character to the left of question mark in the expression should match 0 or 1 time.For example “be?” matches “b” and “be” but not “bee”.“*”號左邊的那個字符匹配0次或者1次
^ 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.標示表達式區域
/ scape character. If you want to use character “/” itself, you should use “//”.轉義字符,如果你想匹配"/"。請使用"//"
/0你使用正則表達式找到的東西
常用EditPlus正則表達式實例
把img標簽的alt去掉
搜索內容:alt="[^src| ]* 注:"|"符號后有個空格
替換內容:alt=""
把帶屬性和樣式的<font>標簽去掉
第一步:把</font>去掉。
搜索內容:</font>
替換內容:不填
第二步:去掉帶屬性和樣式的<font>標簽
搜索內容:<font [^>]*>
替換內容:不填
去掉所有的空行
搜索內容:/n/n
替換內容:/n
以下是針對特殊中文的一些替換
新聞熱點
疑難解答
圖片精選