开发者

Regex Search and Replace in Eclipse: How do I fix dangling meta character 'x'?

开发者 https://www.devze.com 2023-01-03 08:18 出处:网络
I am trying to replace function calls written when methods were nonstatic to an updated version were 开发者_StackOverflowthey are.

I am trying to replace function calls written when methods were nonstatic to an updated version were 开发者_StackOverflowthey are. For example: TABLE_foo(table1, ...rest is the same with table1.foo(...rest is the same

This is what I have come up with using my limited understanding of regex and this site. find:

TABLE_(*)\((*),

replace:

$2.$1(

The above yields a dangling meta character '*' error. Does anyone know what I am doing wrong?


Assuming Eclipse uses Java-style regexes, try using TABLE_(.*)\((.*) as your find expression.

* means "zero or more of the previous character", and you did not have a previous character so it didn't know what to look for. I inserted a . before them to indicate "any character", but it may work better with [^)]* if it uses greedy matching.

0

精彩评论

暂无评论...
验证码 换一张
取 消