[thelist] Title-case regex in PHP?

Kelly Hallman khallman at wrack.org
Sat Sep 27 16:10:05 CDT 2003


In perl, this does what I want:
$x =~ s/(\w)(\w+)/\U\1\L\2/g;

However, in PHP, this does not work (inserts \U and \L's):
preg_replace("/(\w)(\w+)/","\U$1\L$2",$x);

Any ideas?
Gimme some Saturday love

-- 
Kelly Hallman
http://wrack.org/




More information about the thelist mailing list