Skip to main content

Help! Finding last occurrence of specific string

  • April 26, 2024
  • 1 reply
  • 52 views

nataliagruber
Forum|alt.badge.img+3

I have a base with records that consist of the URLs of several images inside my site's midia folder. They look something like:

Etc, fake examples. 

I would like to extract just the names of the files inside each folder, like:

  • banner1.png
  • banner2.png
  • file.html
  • name.pdf

I figured it might be possible if I could FIND the last '/' on each string and extract whatever comes after it, but I'm not managing. Anyone knows if that's possible? 

1 reply

dilipborad
Forum|alt.badge.img+23
  • Brainy
  • April 27, 2024

Hello @nataliagruber 
Use this simple RegExp function which always gives you perfect results.

REGEX_EXTRACT(url, "[^/]+$")

👍