Convert a char to upper case using regular expressions (EditPad Pro)
TextPad will allow you to perform this operation.
example:
test this sentence
Find what: \([^ ]*\) \(.*\)
Replace with: \U\1\E \2
the \U
will cause all following chars to be upper
the \E
will turn off the \U
the result will be:
TEST this sentence
I know this thread is about EditPad Pro, but I came here because I had the same need with a javascript regexp.
For the people who are here needing the same tip, you can use a function or lambda as the replace argument.
I use the function below to convert css names with -
to the javascript equivalent, for example, "border-top"
will be transformed into "borderTop"
:
s = s.replace(/\-[a-z]/g, x => x[1].toUpperCase());
EditPad Pro and PowerGREP have a unique feature that allows you to change the case of the backreference.
\U1
inserts the first backreference in uppercase,\L1
in lowercase and\F1
with the first character in uppercase and the remainder in lowercase. Finally,\I1
inserts it with the first letter of each word capitalized, and the other letters in lowercase.
Source: Goyvaerts, Jan (2006). Regular Expressions: The Complete Tutorial. Lulu.com. p. 35. ISBN 1411677609. Google Books. Retrieved on June 25, 2010.