title: Is this possible? Using only an one liner JavaScript regexp
body: <p>How can I convert this into an one-liner JavaScript regex?</p>
  
  <pre><code>html.replace(/src="(.*?)"/gi, function($1)
  {  return $1.replace(/(abc.*?)\/abc/gi, "abc");
  });
  </code></pre>
  
  <p>The above code block should be self-explanatory of what I'm trying to accomplish, but I'll elaborate.</p>
  
  <p>What I'm trying to accomplish is replace all matches of this regex /src="(.*?)"/ which contains the substring: abc[random_characters]/abc to just abc. And so for example</p>
  
  <p>src="abc[random_characters]/abc[random_characters]" => src="abc[random_characters]"</p>
  
  <p>Edit: One-liner without the anonymous function call or callback.</p>
  
  <p>Edit: Solution</p>
  
  <pre><code>html.replace(/src="abc(?:.*?)\/(abc[^"]+)"/gi, "src=\"$1\"");
  </code></pre>