I have a string that contains a URL and I want to be able to remove everything in the URL except for the file name and assign this to a variable.
For example:
$URL = "or
$URL = "
There could be more than two subdirectories.
I need to remove all except filename.ext and assign this value to a variable called $filename.
I have been trying to use regular expression substitute to accomplish this but I am fairly new with regular expressions. Any help would be appreciated.
If using a regular expression to do this, could you explain so I could learn what is transpiring.
TIA,
Mike V
For example:
$URL = "or
$URL = "
There could be more than two subdirectories.
I need to remove all except filename.ext and assign this value to a variable called $filename.
I have been trying to use regular expression substitute to accomplish this but I am fairly new with regular expressions. Any help would be appreciated.
If using a regular expression to do this, could you explain so I could learn what is transpiring.
TIA,
Mike V