Regular Expressions and editplus originality are often used to copy Network Content

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.