Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regualr Expression for: Folder path back one slash
#1
Hi,
I have been trying to figure out the RegEx for taking a folder path back one level

e.g.

folderpath = "C:\Test Level Top\Test Level Top minus 1\Test Level Top Minus 2

to become

upfolderpath = "C:\Test Level Top\Test Level Top minus 1"

I know it's something with substrings and replacerx (e.g. "[sample pattern $2, $1),
but I get confused when it's the LAST of something that I have to remove (i.e. how do you know its the last....)

Any good resources on getting better at RegEx that people know. Maybe a place with exercises or something.

Stuart


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)