Regex function to extract data

Hi, I thought maybe there is some regexp pro’s here.

I need to extract clean URL’s from incoming data.

Example:

developer.mozilla.com I need mozilla.com
www.microsoft.com/uber - I need only microsoft.com

Does anyone know regexp function that can extract data after first comma and before / ?

Thanks

Hi @sat_miha,

The following regular expression matches the string between a dot (.) and a slash (/) :

(?<=\.)(.*?)(?=\/)

However it will only work if the URL contains a slash

examples :

Best,

Arthur

2 Likes

Hi, if there is a sollution to include the ones without slash somehow?

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