jquery How to remove an item with or without a comma/space?
<p>Given a Input which can contain values like:</p>

<pre><code>&lt;input type="hidden" value="XXXXXXX" /&gt;

&lt;input type="hidden" value="XXXXXXX, YYYYYYYY" /&gt;

&lt;input type="hidden" value="XXXXXXX, YYYYYYYY, ZZZZZZZZZZ" /&gt;
</code></pre>

<p>I want to use jQuery to remove: XXXXXXX, but if XXXXXXX has a comma after (XXXXXXX,) I need the comma removed to.</p>

<p><strong>This is what I have now:</strong></p>

<pre><code>uuid = XXXXXXX
.val(attachedUUIDs.replace(uuid + ',', '' ));
.val(attachedUUIDs.replace(uuid, '' ));                                 
</code></pre>

<p>Ideas to do this cleanly? Thanks</p>
