Hi all,
I am learning the use of regular expression and I would like to know which regex can be used to select only the last part of a directory path name.
Something like:
/dir1/dir2/dir2
and I want to select the last /dir2 where dir2 can be any kind of string.
thanks to everybody but I think there is a problem because the output printed by the perl script is:
/dir1/dir2/dir2
I think it is due to the ".+" that includes the / character so it matches all the string starting from the first /dir1. Or maybe I did something wrong in my script... I am checking.
However, how can I veto the / from .+ ?