Forum Discussion

MichaelBarrow's avatar
MichaelBarrow
Qrew Cadet
8 years ago

How to extract just the page name from a URL

Let's say I have a text or URL field that contains the following:

http://www.domainname.com/pagename.html

How would I go about extracting just "pagename" without "http://www.domainname.com/" before it and without ".html" after it? And can a formula do it generically so that it can handle a variant like this?

https://domainname.org/directory/pagename2.htm

Note that this example has https instead of http and has no www. and has a different TLD (.org) than the first example (.com) and has a page name that ends in .htm instead of .html

Can this be done with a single formula?