Reputation: 3345
I am attempting to find and replace in eclipse the phrase
doSomething(*,
with
doSomething(*)
(Where * is a wildcard)
I've tried both ctrl+f and ctrl+h. When I use a wildcard, it will find the phrase, but then when it is replaced, it will be replaced with literally, the asterisk, not the phrase that was inside of it. Is there a method to do so (maybe with regular expressions?). If there is not a way in eclipse, is there any software that will?
Upvotes: 2
Views: 1847
Reputation: 70750
You need to enable the Regular expressions
checkbox when you hit CTRL + F
.
Find: (doSomething\([^,]+),
Replace: $1)
Use $n
in replace where n is the n
th occurrence of a capture group ( )
Upvotes: 3
Reputation: 195249
ctrl-f
and checked the Regular expressions
option,
Find: (doSomething\([^,]*),
Replace with: \1)
Upvotes: 2