Code: Select all
^([a-z]) > $1
With regexes in TextPad, I can capitalize the next character with:
Code: Select all
^([a-z]) > \u$1
Code: Select all
^([a-z]) > $1
Code: Select all
^([a-z]) > \u$1
Code: Select all
text recase("the caMel can't.", "title"); //The Camel Can't.
text recase("the caMel can't.", "sentence"); //The camel can't.
Yep, and I wonder why you post a link to some external app for such a trivial task. Hey, this is XY, man!kunkel321 wrote:Not an answer to your question, but the free version of ReNamer can do it...
http://www.den4b.com/?x=products&product=renamer
Edit: You beat me to it Don.
SWEET!!! These are all the related switches in TextPad (and the Boost regex engine, which it uses):admin wrote:Anyway, I just added a switch /u to just uppercase the first letter. This functionality was missing an easy way AFAIK.
Code: Select all
\l - Causes the next character from the format expression to be output in lower case.
\u - Causes the next character from the format expression to be output in upper case.
\L - Causes all subsequent characters to be output in lower case, until a \E is found.
\U - Causes all subsequent characters to be output in upper case, until a \E is found.
Code: Select all
"Capitalize First Letter"
// Unique prefix so Search & Replace is anchored.
$uniq = <date yyyymmddhhnnss> . '-' . rand(0,100) . '__';
// Search list ($uniq . [a-z])
$s = '';
// Replacement list ([A-Z])
$r = '';
// Build the strings for each letter.
$i = 0;
while ($i < 26) {
$s = $s . $uniq . chr(97+$i) . ($i<25 ? '|' : '');
$r = $r . chr(65+$i) . ($i<25 ? '|' : '');
$i++;
}
// Prepend items starting with lowercase characters with the unique prefix.
Rename 'r', '^([a-z]) > ' . $uniq . '$1\', 'p';
// Search and replace rename.
Rename 's', "$s>>$r\", 'p';
I think the new /u switch will meet most real world desires (that are not already met by other XY functions).aliteralmind wrote:SWEET!!! These are all the related switches in TextPad (and the Boost regex engine, which it uses):admin wrote:Anyway, I just added a switch /u to just uppercase the first letter. This functionality was missing an easy way AFAIK.
As documented under "escape sequences" at the bottom of this page.Code: Select all
\l - Causes the next character from the format expression to be output in lower case. \u - Causes the next character from the format expression to be output in upper case. \L - Causes all subsequent characters to be output in lower case, until a \E is found. \U - Causes all subsequent characters to be output in upper case, until a \E is found.