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
Post a Comment