Ok, so I'm slightly embarassed to be posting a regex help question, but I
know one of you beautiful freaks out there can hook me up with a quick answer:
What's the regular expression for making a sentence "Title Case" (a.k.a. Camel Case Like This), if that sentence has an apostrophe in it.
For example, if my $string = "HERE IS A STRING", then this regex:
$string =~ tr/[A-Z]/[a-z]/;
$string =~ s/(\w+)/\u\L$1/g;
will produce "Here Is A String".
But, if my $string = "HERE'S A STRING", the regex above will produce "Here'S A String". (note the capital 'S' after the apostrophe).
Any love out there?
Tom