MyEclipse deletes the line numbers that the Code has copied from the Internet (Regular Expression removes line numbers ),

Source: Internet
Author: User

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

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.