Search code examples
regexeclipseuppercaselowercase

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


I'd like to go through all of my source code files and replace every occurence of k_Xyyy with k_xyyy (switch the first letter after k_ from uppercase to lowercase).

I'm using the eclipse dialog to search and replace multiple files. Right now I have the regex \bk_([A-Z]).

How do I specify the replacement string of the regex?


Solution

  • That is not possible. Either use Eclipse's re-factoring functionality, or replace them one at a time:

    regex       : \bk_A
    replacement : k_a 
    
    regex       : \bk_B
    replacement : k_b 
    
    ...
    
    regex       : \bk_Z
    replacement : k_z