The Eclipse Editor uses regular

Source: Internet
Author: User

The Eclipse editor is powerful, and regular support is sometimes useful. In addition to programming, there are times when you can do something else.
For example: There are tools generated SQL script, but not meet the requirements, need a small change. Do not want to write a program, Perl I will not write, batch processing is not strong enough, how to do, directly with the eclipse of the regular replacement function can do:

For example: SQL is a series of insert statements, separated by newline, in the form of INSERT into t_table (FID,.....) VALUES (' FID value ',....);
To be replaced by: delete from t_table where fid= ' FID value '.

The first step: replace the INSERT into t_table with the delete from t_table where fid=. There is no need for this.
Step Two: Change values (replace with where fid=, which requires a regular:
Will FID([/u0000-/uffff]+?) Values are replaced with empty strings.
Step three: Will (/X2C) ([/u0000-/uffff]+?) (/n) to be replaced by/n

By looping through, you can replace the original string with the expected string.
In fact, the standard regular usage mentioned above is not limited to eclipse, but it is a small difference to use for different editors or compilers.

Related Article

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.