Hi folks,
Could somebody help me with a regular expressions to decode a url? It's for a navbar. I'm getting the current location using the REQUEST_URI environment variable, and now I want to split the string up into directories and put them into an array. The problem is that when I use "split", the first forward slash causes an empty value in the array, and I don't want the filename either.
For example, I would like to return an array like this:
@dirs = ("services", "design", "samples");
from all of these:
/services/design/samples
/services/design/samples/
/services/design/samples/index.htm
Any suggestions?
Thanks,
adam
Could somebody help me with a regular expressions to decode a url? It's for a navbar. I'm getting the current location using the REQUEST_URI environment variable, and now I want to split the string up into directories and put them into an array. The problem is that when I use "split", the first forward slash causes an empty value in the array, and I don't want the filename either.
For example, I would like to return an array like this:
@dirs = ("services", "design", "samples");
from all of these:
/services/design/samples
/services/design/samples/
/services/design/samples/index.htm
Any suggestions?
Thanks,
adam