In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to use DW regular expression batch replacement, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Idea: want to replace BBBBBBB with BBBBBBB
If "BBBBBBB" is the same, it's so simple, and if the content is different, you can't use the simple find and replace function. Then use DW regular expressions to replace in batches.
To replace the content:
Replace the effect to be achieved:
Replaced regular expression:
Note: (.\ S+)-used to replace the anchor text {S in the A tag is uppercase and represents any single non-blank character. }.
$1 is a parameter that references the anchor text (.\ S+) in the A tag.
Note: if it is non-numeric (.\ S+), if it is a number, use d, that is, (.\ d +).
Final result:
The DW regular expression table description is provided below.
Character
Match
Example
^
The beginning of the input or line.
^ T matches "T" in "This good earth" but does not match "T" in "Uncle Tom's Cabin".
$
Enter or the end of the line.
H $matches "h" in "teach", but not "h" in "teacher"
*
0 or more leading characters.
Um* matches "um" in "rum", "umm" in "yummy" and "u" in "huge"
+
1 or more leading characters.
Um+ matches "um" in "rum" and "umm" in "yummy", but there is no match in "huge"
?
The leading character appears at most once (that is, indicates that the leading character is optional).
St?on matches "son" in "Johnson" and "ston" in "Johnston", but there is no match in "Appleton" and "tension"
.
Any single character except a newline character.
.an matches "ran" and "can" in the phrase "bran muffins can be tasty"
X | y
X or y.
FF0000 | 0000FF matches "FF0000" in bgcolor= "# FF0000" and "0000FF" in font color= "# 0000FF"
{n}
Exactly n leading characters.
O {2} matches "oo" in "loom" and the first two "o" in "mooooo", but there is no match in "money"
{n,m}
At least n or at most m leading characters.
F {2 4} matches "FF" in "# FF0000" and the first four "F" in "# FFFFFF"
[abc]
Any of the characters enclosed in parentheses. Specify a range of characters with a hyphen (for example, [amurf] is equivalent to [abcdef]).
[eMurg] matches "e" in "bed", "f" in "folly" and "g" in "guard"
[^ abc]
Any character not enclosed in parentheses. Specify a range of characters with a hyphen (for example, [^ a murf] is equivalent to [^ abcdef]).
[^ aeiou] initially matches "r" in "orange", "b" in "book" and "eek!" "k" in
\ b
Word boundaries (such as spaces or carriage returns).
\ bb matches "b" in "book", but there is no match in "goober" and "snob"
\ B
Anything outside the boundary of a word.
\ Bb matches "b" in "goober", but there is no match in "book"
\ d
Any numeric character. Equivalent to [0-9].
\ d match "3" in "C3PO" and "2" in "apartment 2G"
\ d
Any non-numeric character. Equivalent to [^ 0-9].
\ d matches "S" in "900s" and "Q" in "Q45"
\ f
Change page characters.
\ n
Newline character.
\ r
Carriage return.
\ s
Any single white space character, including spaces, tabs, page breaks, or line breaks.
\ sbook matches "book" in "blue book", but there is no match in "notebook"
\ s
Any single non-white space character.
\ Sbook matches "book" in "notebook", but there is no match in "blue book"
\ t
Tabs.
\ w
Any alphanumeric character, including underscores. Equivalent to [A-Za-z0-9].
B\ w * matches "barking" in "the barking dog" and "big" and "black" in "the big black dog"
\ W
Any non-alphanumeric character. Equivalent to [^ A-Za-z0-9].
\ W matches "%" in "&" and "100%" in "Jake&Mattie"
The above is all the content of the article "how to use DW regular expressions to replace in batches". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.