Question: I'm looking for a way to change the first character of every word in a sentence form lowercase to uppercase. I already read the [following answer](https://stackoverflow.com/questions/1159343/convert-a-char-to-upper-case-using-regular-expressions-editpad-pro/1159389#1159389) but it doesn't work.

I tried to use `\U` to replace the first letter as an uppercase letter. But it returns \U as the replacement, not the first letter. May someone take a look at <http://regexr.com?36h59>

Thank you in advance!

Answer: 
```
$ echo 'xyzzy plugh dwarf' | sed 's/\(\<.\)\.*/\u\1/g' 
Xyzzy Plugh Dwarf

```
If your coding using PHP check out the manual here: 
<http://php.net/manual/en/function.ucwords.php>