Saturday, January 27, 2007

Perl regex to capitalize each word

I always forget how to use Perl regex to capitalize every word in a string buffer. So here it is for future reference:
$buffer =~ s/\b\w/\u\L$&/g;