How to replace uppercase letters to lowercase letters using regex in Eclipse?

I just resolved the same task (had to turn .net interface into java interface) utilizing the power of VIM 🙂

void DoMethod1 -> void doMethod1
Foo PerformMethod2 -> Foo performMethod2
:%s/\(^\s*\w\+\s\+\)\([A-Z]\)/\1\L\2/g

Here we are searching for (optional indentation followed by return type followed by whitespace) followed by (Uppercase letter). Braces are capturing groups. Then we are performing a replacement first capturing group \1 lowercase \L second capturing group \2.

This of course requires you to open file in Vim, but anyway this is much faster then doing the same thing by hand in Eclipse.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)