In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to use the search function of notepad++. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Search function of notepad++ (regular expression)
We know that notepad++ is a very powerful editor, and we believe that students must be a necessary tool for machine installation. It has a very friendly support for text editing and viewing, and it is also very good for dealing with larger files. For example, our system runs in the process of generating a text format of the log, it is usually a relatively large file, generally we can use notepad++ to quickly open the log file. However, for log files, it records a variety of information from different places, such as various services, processes, threads, modules, and so on. When we analyze the log file, sometimes to quickly locate the problem or the problem of a related module, we need to use its search function, we need to match specific keywords to search for useful information and view the relevant log content. On the notepad++ search function, the direct shortcut key Ctrl+F can directly call up the search window.
When you see this, you must think that there is nothing to learn from this! Haha, that's right. We all know the above common sense. However, as you can see from the figure above, notepad++ supports three search modes:
Normal mode
Expansion mode
Regular expression pattern
Notepad++ 's regular expression pattern, like his name, supports regular expression search, and when we are familiar with the use of regular expressions, I believe you will fall in love with using this feature of notepad++.
Common expression
Some common regular expression matching symbols are listed below, which are convenient for students to find and learn.
Character description. Match any character * matches the preceding character 0 or more, for example, ab* matches "a", "ab" or "abb" + matches the preceding character one or more times, for example, ab+ matches "ab" or "abb" but not "a"? Match the preceding characters 0 or 1 times, for example, ab? Matches "a" or "ab", but not "abb" {n} matches the previous character or grouping n times, for example, ab {2} c matches "abbc". {mforce n} matches the previous character or group at least m times and up to n times (if n is empty, it represents any number of times), for example, ab {2} 3} c matches the expression to the right of "abbc" or "abbbc" ^ at the beginning of a line, for example ^ a match the line starting with "a" the expression to the left of $is matched at the end of the line, for example, z $matches the line ending with "z" [] matches any single character in the list, for example, [ab] matches "a" or "b" [0-9] matches any single 0-9 number [^] any single character outside the matching list. For example, [^ ab] matches a single character other than "a" and "b".\ w matches a single character, including an underscore, which is equivalent to [A-Za-z0-9]\ W matching non-single characters, equivalent to [^ A-Za-z0-9]\ d matching numeric characters, equivalent to [0-9]\ D matching non-numeric characters. Equivalent to [^ 0-9]\ b matching word boundaries (beginning or end), for example,\ bhe matches "hello" but does not match "ahello"\ B matches non-word boundaries | or operators, matches left or right expressions\ s match white space\ S matches non-white space\\ matching characters\\ t matches Tab tab\ r matches carriage return\ n matches line feed\ r
Marking and grouping
The above symbol is for one character or repeats one character, but what if it is multiple characters? We need to use grouping. For grouping, you can use parentheses () to specify grouping expressions, for example: (abc)? Indicates that 0 or 1 abc are matched, where the expression in parentheses is a grouping. Grouping can be divided into two forms, capture group and non-capture group. Capture groups can be numbered by calculating their opening brackets from left to right, while non-capture groups can be numbered by (?) The group at the beginning, which does not capture text.
Character description (...) A set of captures. You can access the first group through\ 1 and the second through\ 2. (?:...) Non-capture group. (? =...) Non-capture group-forward assertion. For example, the (. *) (? = ton) expression will match to 'Apple'. (?) when it encounters a' Appleton' string. Non-capture group-negative backward assertion. For example, when 'sir William'' is encountered, it will match 'William'. (? P …). Name the captured group. Submit a name to the group for later use, for example, (? PA [^\ s] +)\ s (? P=first) matches' Apple Apple'. Similar to (A [^\ s] +)\ s\ 1, but using a group name instead of a number. (? = name) matches a group named name. (? # comment) Annotation-the contents in parentheses are ignored when matching.
Careful students will find that in addition to the search function supports regular expressions, the replacement function of notepad++ also supports regular expressions. The above symbols are also applicable in substitution.
This is the end of the article on "how to use the search function of notepad++". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.