title: Filter out single instance of string from a single line containing multiple similar matches with grep or sed?
body: <p>I have been making a shell script to be able to download a certain experimental branch of Blender from <a href="https://builder.blender.org/download/experimental/" rel="nofollow noreferrer">their website.</a> When curling the site all versions appear in a really (and I mean really long) string of all the html together. I can grep (ripgrep spcecifically) only the Linux versions, but when wanting to grep or even sed again, all the filenames start with &quot;https://&quot; and end with &quot;.tar.xz&quot;.</p>
  <p>And they are all on the same line, so matching the beginning of the first also matches the end of the very last match.</p>
  <pre><code>os linux&quot; &gt;&lt;a href=&quot;https://builder.blender.org/download/experimental/blender-3.0.0-alpha+asset-browser-poselib.fba8de2e8688-linux.x86_64-release.tar.xz&quot; title=&quot;Download linux 64bit tar.xz file&quot; class=&quot;js-ga&quot; ga_label=&quot;linux 64bit tar.xz file&quot; ga_type=&quot;button&quot; ga_cat=&quot;download&quot;&gt;&lt;span class=&quot;name&quot;&gt;Blender 3.0.0 - &lt;span class=&quot;build-var next&quot;&gt;asset-browser-poselib&lt;/span&gt;&lt;small&gt;May 22, 05:26:55 - asset-browser-poselib - fba8de2e8688 - tar.xz - 149.56MB&lt;/small&gt;&lt;/span&gt;&lt;span class=&quot;build&quot;&gt;x64&lt;/span&gt;&lt;span class=&quot;size&quot;&gt;release&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class=&quot;os linux&quot; style=&quot;display:none;&quot;&gt;&lt;a href=&quot;https://builder.blender.org/download/experimental/blender-3.0.0-alpha+asset-browser-poselib.fba8de2e8688-linux.x86_64-release.tar.xz.sha256&quot; title=&quot;Download linux 64bit sha256 file&quot; class=&quot;js-ga&quot; ga_label=&quot;linux 64bit sha256 file&quot; ga_type=&quot;button&quot; ga_cat=&quot;download&quot;&gt;&lt;span class=&quot;name&quot;&gt;Blender 3.0.0 - &lt;span class=&quot;build-var next&quot;&gt;asset-browser-poselib&lt;/span&gt;&lt;small&gt;May 22, 05:26:55 - asset-browser-poselib - fba8de2e8688 - sha256 - 65.00B&lt;/small&gt;&lt;/span&gt;&lt;span class=&quot;build&quot;&gt;x64&lt;/span&gt;&lt;span class=&quot;size&quot;&gt;release&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class=&quot;os linux&quot; &gt;&lt;a href=&quot;https://builder.blender.org/download/experimental/blender-3.0.0-alpha+cycles-x.a117a9c63c3a-linux.x86_64-release.tar.xz&quot; title=&quot;Download linux 64bit tar.xz file&quot; class=&quot;js-ga&quot; ga_label=&quot;linux 64bit tar.xz file&quot; ga_type=&quot;button&quot; ga_cat=&quot;download&quot;&gt;&lt;span class=&quot;name&quot;&gt;Blender 3.0.0 - &lt;span class=&quot;build-var next&quot;&gt;cycles-x&lt;/span&gt;&lt;small&gt;May 22, 05:03:02 - cycles-x - a117a9c63c3a - tar.xz - 143.11MB&lt;/small&gt;&lt;/span&gt;&lt;span class=&quot;build&quot;&gt;x64&lt;/span&gt;&lt;span class=&quot;size&quot;&gt;release&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class=&quot;os linux&quot; style=&quot;display:none;&quot;&gt;&lt;a href=&quot;https://builder.blender.org/download/experimental/blender-3.0.0-alpha+cycles-x.a117a9c63c3a-linux.x86_64-release.tar.xz.sha256&quot; title=&quot;Download linux 64bit sha256 file&quot; class=&quot;js-ga&quot; ga_label=&quot;linux 64bit sha256 file&quot; ga_type=&quot;button&quot; ga_cat=&quot;download&quot;&gt;&lt;span class=&quot;name&quot;&gt;Blender 3.0.0 - &lt;span class=&quot;build-var next&quot;&gt;cycles-x&lt;/span&gt;&lt;small&gt;May 22, 05:03:02 - cycles-x - a117a9c63c3a - sha256 - 65.00B&lt;/small&gt;&lt;/span&gt;&lt;span class=&quot;build&quot;&gt;x64&lt;/span&gt;&lt;span class=&quot;size&quot;&gt;release&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class=&quot;os linux&quot; style=&quot;display:none;&quot;&gt;&lt;a href=&quot;https://builder.blender.org/download/experimental/blender-3.0.0-alpha+override-recursive-resync.0d2c5bf06726-linux.x86_64-debug.tar.xz.sha256&quot; title=&quot;Download linux 64bit sha256 file&quot; class=&quot;js-ga&quot; ga_label=&quot;linux 64bit sha256 file&quot; ga_type=&quot;button&quot; ga_cat=&quot;download&quot;&gt;&lt;span class=&quot;name&quot;&gt;Blender 3.0.0 - &lt;span class=&quot;build-var next&quot;&gt;override-recursive-resync&lt;/span&gt;&lt;small&gt;May 20, 12:38:57 - override-recursive-resync - 0d2c5bf06726 - sha256 - 65.00B&lt;/small&gt;&lt;/span&gt;&lt;span class=&quot;build&quot;&gt;x64&lt;/span&gt;&lt;span class=&quot;size&quot;&gt;debug&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class=&quot;os linux&quot; &gt;&lt;a href=&quot;https://builder.blender.org/download/experimental/blender-3.0.0-alpha+override-recursive-resync.0d2c5bf06726-linux.x86_64-debug.tar.xz&quot; title=&quot;Download linux 64bit tar.xz file&quot; class=&quot;js-ga&quot; ga_label=&quot;linux 64bit tar.xz file&quot; ga_type=&quot;button&quot; ga_cat=&quot;download&quot;&gt;&lt;span class=&quot;name&quot;&gt;Blender 3.0.0 - &lt;span class=&quot;build-var next&quot;&gt;override-recursive-resync&lt;/span&gt;&lt;small&gt;May 20, 12:38:56 - override-recursive-resync - 0d2c5bf06726 - tar.xz - 157.56MB&lt;/small&gt;&lt;/span&gt;&lt;span class=&quot;build&quot;&gt;x64&lt;/span&gt;&lt;span class=&quot;size&quot;&gt;debug&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class=&quot;os linux&quot; &gt;&lt;a href=&quot;https://builder.blender.org/download/experimental/blender-3.0.0-alpha+override-recursive-resync.0d2c5bf06726-linux.x86_64-release.tar.xz&quot; title=&quot;Download linux 64bit tar.xz file&quot; class=&quot;js-ga&quot; ga_label=&quot;linux 64bit tar.xz file&quot; ga_type=&quot;button&quot; ga_cat=&quot;download&quot;&gt;&lt;span class=&quot;name&quot;&gt;Blender 3.0.0 - &lt;span class=&quot;build-var next&quot;&gt;override-recursive-resync&lt;/span&gt;&lt;small&gt;May 20, 11:50:22 - override-recursive-resync - 0d2c5bf06726 - tar.xz - 149.73MB&lt;/small&gt;&lt;/span&gt;&lt;span class=&quot;build&quot;&gt;x64&lt;/span&gt;&lt;span class=&quot;size&quot;&gt;release&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class=&quot;os linux&quot; style=&quot;display:none;&quot;&gt;&lt;a href=&quot;https://builder.blender.org/download/experimental/blender-3.0.0-alpha+override-recursive-resync.0d2c5bf06726-linux.x86_64-release.tar.xz.sha256&quot; title=&quot;Download linux 64bit sha256 file&quot; class=&quot;js-ga&quot; ga_label=&quot;linux 64bit sha256 file&quot; ga_type=&quot;button&quot; ga_cat=&quot;download&quot;&gt;&lt;span class=&quot;name&quot;&gt;Blender 3.0.0 - &lt;span class=&quot;build-var next&quot;&gt;override-recursive-resync&lt;/span&gt;&lt;small&gt;May 20, 11:50:22 - override-recursive-resync - 0d2c5bf06726 - sha256 - 65.00B&lt;/small&gt;&lt;/span&gt;&lt;span class=&quot;build&quot;&gt;x64&lt;/span&gt;&lt;span class=&quot;size&quot;&gt;release&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class=&quot;os linux&quot; &gt;&lt;a href=&quot;https://builder.blender.org/download/experimental/blender-3.0.0-alpha+profiler-editor.ab200c6eddc6-linux.x86_64-release.tar.xz&quot; title=&quot;Download linux 64bit tar.xz file&quot; class=&quot;js-ga&quot; ga_label=&quot;linux 64bit tar.xz file&quot; ga_type=&quot;button&quot; ga_cat=&quot;download&quot;&gt;&lt;span class=&quot;name&quot;&gt;Blender 3.0.0 - &lt;span class=&quot;build-var next&quot;&gt;profiler-editor&lt;/span&gt;&lt;small&gt;May 20, 04:54:26 - profiler-editor - ab200c6eddc6 - tar.xz - 149.54MB&lt;/small&gt;&lt;/span&gt;&lt;span class=&quot;build&quot;&gt;x64&lt;/span&gt;&lt;span class=&quot;size&quot;&gt;release&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class=&quot;os linux&quot; style=&quot;display:none;&quot;&gt;&lt;a href=&quot;https://builder.blender.org/download/experimental/blender-3.0.0-alpha+profiler-editor.ab200c6eddc6-linux.x86_64-release.tar.xz
  </code></pre>
  <p>I trued using ripgrep (or grep):
  <code>rg -o 'https.*tar\.xz'</code> But that is exactly what matches from the first filename all the way to the last, maybe using AND logic in grep could help?</p>
  <p>The URL from the string that I want is the following:</p>
  <pre><code>https://builder.blender.org/download/experimental/blender-3.0.0-alpha+cycles-x.a117a9c63c3a-linux.x86_64-release.tar.xz
  </code></pre>
  <p>How could I filter out that specific URL string if they start and end the same?</p>