Skip to main content
Question

How to extract just the page name from a URL

  • June 27, 2017
  • 0 replies
  • 50 views

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?
This topic has been closed for replies.

Try this

var text RightToSlash = right([my field],"/");
Left($RightToSlash,".")

  • Author
  • Registered
  • June 27, 2017
Wonderful (and very elegant)! Thank you, Mark!