java - replace regular expression capture with its upper variant -


i using string.replaceall(string, string) replace regular expression. that:

"test test test word".replaceall("(?i)(\\w+)", "$1") 

i need replace capture upper variant, there way or need use java.util.regex.matcher?

check out string method: touppercase

what suggest (not tested) like:

 "test test test word".replaceall("[magic regex]", "$1".touppercase()) 

@david knipe correct (comment). other thing think of along lines of first char upper case in context messy fast. if find way, better, going leave here in case there no other alternative.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -