Strip URL's of parameters in Tableau

Version 1

    Description:  I often need to parse Google Analytics data or any other data that contains a list of URL's.  While doing this, I need to remove the parameters that appear at the end of a content url so pages can be grouped together properly for analysis.

     

     

    Example of raw data: 

     

    URL
    https://www.example.com/page1/content_url?900341
    https://www.example.com/page1/content_url?900345
    https://www.example.com/page1/content_url?900689
    https://www.example.com/page2/content_url?98ad&46&25
    https://www.example.com/page3/content_url?98aaass46&25
    https://www.example.com/page44/content_url?900341
    https://www.example.com/page44/content_url?900345
    https://www.example.com/page44/content_url?900689
    https://www.example.com/page45/content_url?98ad&46&25
    https://www.example.com/page46/content_url?98aaass46&25

     

     

     

    Screenshot of desired end:

     

    The way to do this is to utilize a Regex command that will strip off the ? and all remaining content on the url:

     

    REGEXP_EXTRACT([URL],'([^\?]+)(\?.*)?')

     

     

    Tableau Version: 2019.1

     

    Original AuthorPatrick Van Der Hyde