Find Replace Short Part of URL using Javascript
<p>Assume I have the following URL stored in variable called <code>content</code>:</p>

<pre>
http://www.example.com/watch?v=4444444&feature=related
</pre>

<hr>

<p><strong>Problem:</strong></p>

<ol>
<li>I need to replace watch?v= with embed/</li>
<li>I need to erase whatever comes after &amp;</li>
</ol>

<hr>

<p>The final output would look like:</p>

<pre>
http://www.example.com/embed/4444444
</pre>

<p>I tried these two steps but didn't work:</p>

<pre><code>content = content.replace('/watch?v=/', 'embed/');
content = content.replace('&amp;*/g','');
</code></pre>

<p>The URL in page source code appears as:</p>

<pre>
http://www.example.com/watch?v=4444444&amp;feature=related
</pre>
