title: Extract part of URL with Google tag manager using regex
body: <p>i'm looking for something similar to: <a href="https://stackoverflow.com/questions/45590669/extract-part-of-url-with-google-tag-manager">Extract part of URL with Google tag manager</a></p>
  
  <p>But with the difference in end of the url, where some ends with a / and some not.</p>
  
  <p>My urls:</p>
  
  <ul>
  <li>/mobilabonnement/mobilabonnement-for-alle/smart-12-gb
  /mobilabonnement/mobilabonnement-for-alle/smart-12-gb/<br>
  /mobilabonnement/mobilabonnement-for-ungdom/smart-ung-12-gb<br>
  /mobilabonnement/mobilabonnement-for-ungdom/smart-ung-12-gb/</li>
  </ul>
  
  <p>I'm trying to extract the "smart-12-gb" and "smart-ung-12-gb".</p>
  
  <pre><code>function(){
  
    var myRegexp = /(smart-|ung-|barn-)(.*)/g;
    var result = {{Updated Page Path}}.match(myRegexp);
  
    if(result !== null){
      result[0] = result[0].replace("/","");
      return result[0];
    }else{
      return null; 
    }
  }
  </code></pre>
  
  <p>This function works, but i was wondering if it's possible to do it in one go, in regex?</p>