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