Home > Web Front-end > JS Tutorial > body text

Regular rules commonly used when copying content on the Internet editplus [original]_javascript skills

WBOY
Release: 2016-05-16 19:23:33
Original
939 people have browsed it

As follows:
1. Replace the starting numbers in the article

Copy the code The code is as follows:

1 <script> <br> 2 <br> 3 var tt=/* Please define tt here */; <br> 4 <br> 5 var errCount=0 //Global Variable, used to record the number of assertion declarations in the assert function <br> 6 <br> 7 /* <br> 8 Assert function <br> 9 If v is false, the function alert("assert error"), and accumulates Counter errCount <br>10 If v is true, do nothing <br>11 */ <br>12 function assert(v) { <br>13 if (!v) { <br>14 alert("assert error"); <br>15 errCount ; <br>16 } <br>17 } <br>18 <br>19 assert((tt || true) == false) <br>20 assert((tt || false) == false) <br>21 assert((tt && true) == true) <br>22 assert((tt && false) == false) <br>23 assert((true || tt) == true) <br>24 assert((tt || true ) == false) <br>25 assert((false || tt ) == false) <br>26 assert((tt || false ) == false) <br>27 assert((true && tt) == false) <br>28 assert((tt && true) == true) <br>29 assert((false && tt) == false) <br>30 assert ((tt && false ) == false) <br>31 <br>32 assert((tt ? true : false) == true) <br>33 assert((tt == false) == true) <br> 34 assert((!tt == tt ) == true) <br>35 assert((tt '') == "false") <br>36 assert(tt == false) <br>37 <br>38 <br>39 alert(errCount) //The result is to print 0 <br>40 <br>41 </script>
42

It would be great if we removed these numbers, we You can use editplus to help us solve the problem faster
ctrl h search content input ^ ?[0-9]
Note that there is an empty character between ^ and ?, you can directly Just copy it from the text you want to replace
Let me explain the principle, mainly using regular expressions
Note that editplus does not seem to support numbers like d that replace [0-9]. For specific regular expressions, you can refer to Things in the Script Home site
2. Replace blank lines . Sometimes there are many blank lines in the article. If we use the editor directly, a lot of useless spaces may be added ( ) , affecting speed and appearance.
Regular: ^[sS| ]*nThe spaces in the middle can be copied from blank lines in the text that cannot be replaced.

3 You can implement complex substitutions by marking
( [a-z_] )(=)([a-z_0-9./] )
12 "3"


This page will continue to be updated www.jb51.net
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template