Add (or remove) specific items from a list

I am using an API that outputs URLs in either text delimited by a comma, or into a text list.

How do I either add only specific URLs of a particular domain (or remove URLs not part of the domain i.e. www.domain.com).

I am spinning my wheels and have tried both the single text of strings delimited by a comma and the list, and have not worked out how to do it.

Appreciate your help!

Regex is great for this :slight_smile: specifically bubble’s :extract with regex operator.

I think this regex pattern should work:
‘\b(?:https?://)?(?:www.)?domain.com(?:(/|&)[^\s,\n]*)?\b’
Replace domain and .com with your actual domain.

Try putting the regex pattern and the API output in and https://regex101.com/ and checking whether it catches all the URLs in your domain.

The above Regex pattern will catch all domains regardless of whether they have www. or https:// or if they have parameters in the URL (&key=param?key2=param2 etc…)

1 Like

Legend - thank you! For others down the track, I used the following regex:

https?://(?:www.)?example.com\S*

I then set list - :each item;extracted by Regex

Appreciate it Nico.

This topic was automatically closed after 70 days. New replies are no longer allowed.