Question about regex in replace

Hello

I need some help using regular expressions in search/replace. For example I have this line:

and want to replace "a=5" with "a = 5". Line 2 should remain unchanged. In Replace text dialog:
Text to find: "\S=\S"
Replace with: ??

(This is just an example, which of course could be solved without regex, reformat code for instance.)

Bye,
Dag.

2 comments

(\S)=(\S) by $1 = $2

Dag Welinder wrote:

Hello

I need some help using regular expressions in search/replace. For example I have this line:

 int b = 5]]>

and want to replace "a=5" with "a = 5". Line 2 should remain unchanged. In Replace text dialog:
Text to find: "\S=\S"
Replace with: ??

(This is just an example, which of course could be solved without regex, reformat code for instance.)

Bye,
Dag.



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please sign in to leave a comment.