MyEclipse deletes the line numbers that the Code has copied from the Internet (Regular Expression removes line numbers ),
I. Regular Expressions remove code line numbers
As developers, we often copy some code from the Internet. Sometimes the copied code is preceded by a line number, such:
MyEclipse provides the search replacement function and supports regular expression replacement. Using Regular Expression replacement, you can easily remove these line numbers.
Use shortcuts"Ctrl + F"Enable the find and replace function of MyEclipse, as shown in:
In this way, all row numbers in the code can be removed.
Removes the regular expression of the code line number.: ^ \ S * \ d + \.
Share the following code, for example, copied online:
1<HTML> 2 3<HEAD> 4 5<TITLE> New Document </TITLE> 6<META NAME="Generator" CONTENT="EditPlus"> 7……8</BODY> 9</HTML>
Is it annoying to have a row number?
There are two common solutions. You must know that regular expressions are used.
Method 1:
To use the search and replacement functions of common development tools, you must support regular expressions, such as my commonly used text editor Notepad ++.
Open Search replacement (ctrl + h), select regular mode, regular expression: ^ \ s * \ d + \.
This method is the same as above.
Method 2: If your development tool is not easy to use, you can download and use thisRegular Expression Testing Tool
Running isCommands-> run
I hope this article will solve the problem of having a line number in the Code copied from the Internet. I hope you will like it and pay more attention to the small series of articles.
Articles you may be interested in:
- Detailed steps for adding a row number to dhtmlxGrid
- Correct code and Analysis for displaying row numbers in the DataGridView Control
- Example code of FLEX to obtain the row number and column number of the DataGrid
- . Net development: detailed explanation of how to add a line number to the code
- Using the sys template and the logging module in python to obtain the row number and function name
- Pycharm usage experience (4) display the row number
- Remove the row number before the code using Python