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: 
If text transformations are possible depends on the regexp implementation. Most standard implementations base off Perl regular expressions and do not support this.

A lot of text editors however do provide some way of transformations as they do not have any other capabilities of processing a regular expression match. For example the answer in your linked question refers to an editor called “TextPad”. These transformations are often non-standard and can also differ a lot depending on what tool you use. When using programming languages however, you don’t really need those features built into the regular expression syntax, as you can easily store the match and do some further processing on your own. A lot language also allow you to supply a function which is then called to process every replacement individually.

If you tell us what language you are using, we might be able to help you further.

### Some examples

JavaScript:

```
> text = 'anleitungen gesundes wohnen';
> text.replace(/(\w+)/g, function(x) { return x[0].toUpperCase() + x.substring(1) });
'Anleitungen Gesundes Wohnen'

```

Python:

```
>>> import re
>>> text = 'anleitungen gesundes wohnen'
>>> re.sub('(\w+)', lambda x: x.group(0).capitalize(), text)
'Anleitungen Gesundes Wohnen'

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