Page 1 of 1

Regex Convert to Uppercase

Posted: 02 Apr 2014 23:11
by 98b427af
What's the Automatic regex syntax for converting lowercase to uppercase? For example I expect:

replaceAll("two words", '\\b([a-z])', '\U$1')

To produce "Two Words" but it doesn't.

Re: Regex Convert to Uppercase

Posted: 04 Apr 2014 09:43
by Martin
To my knowledge the built-in regex support of Java (used by Automagic) does not have a way to directly convert the case within a replacement pattern.
You might need to split the string manually and use function toUpperCase and toLowerCase on the characters you want to convert.