Home Web Front-end JS Tutorial Regular rules commonly used when copying content on the Internet editplus [original]_javascript skills

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

May 16, 2016 pm 07:23 PM
editplus regular

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
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to set the background color in editplus-How to set the background color in editplus How to set the background color in editplus-How to set the background color in editplus Mar 04, 2024 pm 07:00 PM

Friends, do you know how to set the background color in editplus? Today I will explain how to set the background color in editplus. If you are interested, come and take a look with me. I hope it can help you. Step 1: First open editplus, click Tools above, as shown in the picture: Step 2: In the tool menu, click preferences, as shown in the picture: Step 3: In the preferences page, click colors on the left, as shown in the picture: Chapter 3 Step 4: In the background position, select a color as needed, as shown in the figure:

How to display blank characters in editplus-How to display blank characters in editplus How to display blank characters in editplus-How to display blank characters in editplus Mar 04, 2024 pm 06:10 PM

Many people don’t know how to display blank characters in editplus? The article brought to you today is about how to display blank characters in editplus. If you still don’t know, let’s learn it with the editor. Step 1: First open the editplus software, select the view option on the navigation bar, and click to open. Step 2: Open the interface as shown below, select the option to display blank characters, and click Open. Step 3: Open the interface as shown below and click to select the all blank characters option, so that all blank characters in editplus will be displayed.

How to match multiple words or strings using Golang regular expression? How to match multiple words or strings using Golang regular expression? May 31, 2024 am 10:32 AM

Golang regular expressions use the pipe character | to match multiple words or strings, separating each option as a logical OR expression. For example: matches "fox" or "dog": fox|dog matches "quick", "brown" or "lazy": (quick|brown|lazy) matches "Go", "Python" or "Java": Go|Python |Java matches words or 4-digit zip codes: ([a-zA

How to replace a string starting with something with php regular expression How to replace a string starting with something with php regular expression Mar 24, 2023 pm 02:57 PM

PHP regular expressions are a powerful tool for text processing and conversion. It can effectively manage text information by parsing text content and replacing or intercepting it according to specific patterns. Among them, a common application of regular expressions is to replace strings starting with specific characters. We will explain this as follows

How to close the file directory window in editplus-How to close the file directory window in editplus How to close the file directory window in editplus-How to close the file directory window in editplus Mar 05, 2024 pm 05:31 PM

Friends, do you know how to close the file directory window in editplus? Today I will explain how to close the file directory window in editplus. If you are interested, come and take a look with me. I hope it can help you. Step 1: First open the editplus software, as shown below, select the view option in the navigation bar, and click to open. Step 2: Open the interface as shown below, select the toolbar/view option, and click Open. Step 3: Open the interface as shown below, click the left mouse button to uncheck the directory and file window options. Step 4: After canceling, you can see that the editplus software file directory window has been closed, as shown below.

How to use regular expressions to remove Chinese characters in php How to use regular expressions to remove Chinese characters in php Mar 03, 2023 am 10:12 AM

How to remove Chinese in PHP using regular expressions: 1. Create a PHP sample file; 2. Define a string containing Chinese and English; 3. Use "preg_replace('/([\x80-\xff]*)/i', '',$a);" The regular method can remove Chinese characters from the query results.

How to use regular matching to remove html tags in php How to use regular matching to remove html tags in php Mar 21, 2023 pm 05:17 PM

In this article, we will learn how to remove HTML tags and extract plain text content from HTML strings using PHP regular expressions. To demonstrate how to remove HTML tags, let's first define a string containing HTML tags.

How to verify if a URL is HTTPS protocol using PHP regex How to verify if a URL is HTTPS protocol using PHP regex Jun 24, 2023 am 08:16 AM

Website security has attracted more and more attention, and using the HTTPS protocol to ensure the security of data transmission has become an important part of current website development. In PHP development, how to use regular expressions to verify whether the URL is HTTPS protocol? here we come to find out. Regular expression Regular expression is an expression used to describe rules. It is a powerful tool for processing text and is widely used in text matching, search and replacement. In PHP development, we can use regular expressions to match http in the URL

See all articles