Webstrom IDE Regular Replacement

Source: Internet
Author: User

Ide:webstrom

Other Ides, which you can test yourself.

Objective.

Add Excel Table Two column (typically Chinese name, English name, and change to JavaScript object)

From

Site Intranet IP Address

IP_Address

SOURCE Extranet IPV4 Address

Src_ip

SOURCE Extranet IPV6 Address

Src_ipv6

SOURCE Extranet IPv4 Start port number

Src_port_start

SOURCE extranet IPv4 End Port number

Src_port_end

To

var obj={"site Intranet IP Address": "IP_Address","source extranet IPv4 Address": "Src_ip","source extranet IPv6 Address": "Src_ipv6 "}

A colleague changes the data manually, telling him that he can use a direct regular match.

It's too simple to get rid of line breaks or anything.

can be easily converted to

"Site intranet IP Address": "IP_Address": "Source Extranet IPv4 Address": "Src_ip": "Source extranet IPv6 Address"

This format.

Then the question came. The same ":"

"Site intranet IP Address":

This is going to stay the same.

and

"IP_Address":

This will be changed to "IP_Address", \ n

A lot of people wouldn't do it.

Can think of, with the Chinese character and the letter difference, but many people will not achieve.

Just stick to the solution.

Match

(\w) ":

Replace

$ ", \ n

The key point is on the $ $, which preserves the placeholder data on the regular () match, which is the letter.

Like this boring work content, manual error-prone time-consuming exhausting, can be fully solved with regular.

Webstrom IDE Regular Replacement

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.