MyEclipse deletes the line number that is copied down the code (the line number is removed) _ Regular expression

Source: Internet
Author: User

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:

1 
 

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.

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.