Finding and replacing eclipse using a template

I am trying to remove all id="someId" events, where someId is different in each case. I tried to use this syntax: (id="\w+\"\(\)) , because it was used in similar situations by other posters. But I do not understand the syntax and, of course, it does not work.

Can someone tell me why this syntax is wrong and maybe point me to a resource that explains the syntax?

+6
source share
1 answer

Check the box next to Regular Expressions. Expression

 id\s*=\s*"[^"]+" 

\s* means space, * means zero or more

[^"] means anything other than a quote, + means one or more

To capture a string, use "([^"]+)" and $1 in the replace field.

Additional information at http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

+6
source

Source: https://habr.com/ru/post/927212/


All Articles