notepad++ and Dreamweaver Editor are very powerful, but we usually only in the normal search on, and sometimes we need to replace some of the rules or rules of things, this can be used to replace the regular, the following look at these examples.
For example: Give a list of values, add <option></option>, <a></a>, and so on to some labels.
The code is as follows |
Copy Code |
1 2 3 4 To be replaced by: <option value= "1" >1</option> <option value= "2" >2</option> <option value= "3" >3</option> <option value= "4" >4</option> |
Ctrl+h Open the replacement window and enter in the lookup target: (. +)
Enter in Replace with: <option value= "$1″>$1</option>
Click on "Replace All" to complete this task, very simple.
Here, in Find Target, the () represents a match, and the corresponding representation of the first pair of parentheses in replace with. If you have more than one string to match, use multiple parentheses and pass $, $, $ ... You can replace it. More complex and precise replacements also require more knowledge of regular expressions.
The Dreamweaver replacement input box is larger and is easy to use when multiple lines of content are replaced.
not only Notepad,editplus, Dreamweaver and most other editors also support regular expressions, these editors can also bulk replace files in the specified folder, open files, and so on, quite powerful. For a large number of replacement tasks, take a little more time to understand how to apply a good regular replacement function, you can save a lot of time in the work.