07-22-2007, 10:59 PM
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
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