See the following:
1. Replace the beginning number in the article
Copy codeThe Code is as follows:
1 <script>
2
3 var tt =/* define tt here */;
4
5 var errCount = 0 // global variable, used to record the number of assert function assertions
6
7 /*
8. asserted Functions
9 if the value of v is false, alert ("assert error") is used to accumulate the counter errCount.
10 if v is true, nothing will be done.
11 */
12 function assert (v ){
13 if (! V ){
14 alert ("assert error ");
15 errCount ++;
16}
17}
18
19 assert (tt | true) = false)
20 assert (tt | false) = false)
21 assert (tt & true) = true)
22 assert (tt & false) = false)
23 assert (true | tt) = true)
24 assert (tt | true) = false)
25 assert (false | tt) = false)
26 assert (tt | false) = false)
27 assert (true & tt) = false)
28 assert (tt & true) = true)
29 assert (false & tt) = false)
30 assert (tt & false) = false)
31
32 assert (tt? True: false) = true)
33 assert (tt = false) = true)
34 assert ((! Tt = tt) = true)
35 assert (tt + '') =" false ")
36 assert (tt = false)
37
38
39 alert (errCount) // The result is 0.
40
41 </script>
42
If you want to remove these numbers, we can use editplus to help us solve the problem faster.
Ctrl + h search content Input^? [0-9]
Note: ^ and? There is an empty character. You can simply copy it from the text you want to replace.
Explains the principle and mainly uses regular expressions.
Note that editplus does not support the replacement of [0-9] numbers such as \ d. For more information about the regular expressions, see the content in the script home.
2. replace empty rowsSometimes there are many blank lines in the article. If we use the editor directly, a lot of useless spaces () may be added, which will affect the speed and appearance.
Regular: ^ spaces in the middle of [\ s \ S |] * \ n can be copied from blank lines that cannot be replaced in the text.
3. implement complex replacement and make a mark.
([A-z _] +) (=) ([a-z_0-9./] +)
\ 1 \ 2 "\ 3"
This page will be updated continuously at www.jb51.net