How to extract just the page name from a URL

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
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?
Photo of Michael Barrow

Michael Barrow

  • 2,206 Points 2k badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 50,850 Points 50k badge 2x thumb
Try this

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

Michael Barrow

  • 2,206 Points 2k badge 2x thumb
Wonderful (and very elegant)! Thank you, Mark!