I'm trying to find the substring of a list of URLs but having trouble due to an extra character (forward slash) at the end of one of the URL. Below are two examples of the data:
I'd like to get the last string of the URL--in this case test and test2. However, my current REGEX_SUBSTR is only giving me the substring of the first URL and a null for the second URL since the second URL has a forward slash.
How do I create the query so that it returns both test and test2?
Sample of my REGEXP_SUBSTR query:
REGEXP_SUBSTR(URL, '/([^/]+)$', 1, 1, 'e', 1) as URL_EXTRACT

