#If you don't need the original string: $var =~ s|[^/]+/$||; #If you would like to leave $var unchanged: ($newVar) = $var=~ m|(.+/)[^/]+/$|;
In reply to Re: remove the part of the string that is after the second to last '/'
by abaxaba
in thread remove the part of the string that is after the second to last '/'
by einerwitzen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |