jQuery first and last of given character
<p>I'm trying to be able to select the first and last instances of a given character(s) within a span element.</p>

<p>e.g.</p>

<pre><code>&lt;span class="foo"&gt;hello (this is hello)&lt;/span&gt;
</code></pre>

<p>I want to be able to find the first bracket and the last bracket within this span and append a class them so the output might be:</p>

<pre><code>&lt;span class="foo"&gt;hello &lt;span class="bar"&gt;(this is hello)&lt;/span&gt;&lt;/span&gt;
</code></pre>

<p>Is this possible? I've looked at <code>first</code> in jQuery but it seems to only work for selecting elements rather than characters.</p>
