title: Getting the last segment of an URL
body: <p>Let's say that this is my URL/Link that i have written in an input</p>
  <p><a href="https://www.instagram.com/p/CBt-W4jHZjH/" rel="nofollow noreferrer">https://www.instagram.com/p/CBt-W4jHZjH/</a></p>
  <p>How can I get the &quot;CBt-W4jHZjH&quot; part?</p>
  <p>var link = ?????</p>
  <pre><code>var a = link.val().trim();
  var regex = new RegExp(/^(?!.*\.\.)(?!.*\.$)[^\W][\w.]{0,29}$/);
  var validation = regex.test(a);
  </code></pre>