<p>I am trying to grab the capital letters of a couple of words and wrap them in span tags. I am using <a href="http://php.net/manual/en/function.preg-replace.php" rel="noreferrer">preg_replace</a> for extract and wrapping purposes, but it's not outputting anything.</p>

<pre><code>preg_replace("/[A-Z]/", "&lt;span class=\"initial\"&gt;$1&lt;/span&gt;", $str)
</code></pre>

You need to put the pattern in parentheses
```
/([A-Z])/
```
, like this:
```
```
preg_replace("/([A-Z])/", "<span class=\"initial\">$1</span>", $str)
```
```