One, regular expression to remove code line number
As a developer, we often copy code from the Web, and sometimes the copied code is preceded by a line number, such as:
The myeclipse itself has a find-and-replace feature and supports regular expression substitution, which makes it easy to remove these line numbers using regular substitution
Use the shortcut key "Ctrl+f" to turn on the MyEclipse lookup replacement feature, as shown in the following illustration:
So you can get rid of all the line numbers in your code.
A regular expression that removes a code line number : ^\s*\d+\.
In sharing one for everyone, for example the online copy down code is as follows:
Do you find it annoying to have line numbers?
Commonly used in two ways to solve, we must all know the use of regular ha
Method One:
Using the Find-and-replace feature of common development tools, of course, you need to support regular only, such as my commonly used text editor notepad++
Open Find Substitution (ctrl+h), select regular mode, regular expression: ^\s*\d+\. As shown in figure
This method is the same as the top one.
Method Two, if your development tool is not easy to use, you can download and use this regular test tool
As shown in figure:
Run is commands->run
Hope this article can solve the online copy down to the code with line number of trouble, I hope you like, a lot of attention to small series of articles.