Remove trailing and leading white spaces around delimiter using regex
<p>I am trying to remove white spaces from a string. However, I want to remove spaces around the delimiter and from beginning and ending of the string.</p>

<p><strong>Before:</strong></p>

<p><code>" one two, three , four   ,five  six,seven "</code></p>

<p><strong>After:</strong> </p>

<p><code>"one two,three,four,five six,seven"</code></p>

<p>I've tried this pattern without success:
<code>/,\s+|\s$/g,","</code></p>