in reply to remove the part of the string that is after the second to last '/'

How about

$string =~ s!^(.*/).*?/$!$1!;

Guess I just prefer non-greedy matching to negated character classes.

1. dude, what does mine say?
2. "sweet", what about mine?
3. "dude", what does mine say?
4. GOTO 2
  • Comment on Re: remove the part of the string that is after the second to last '/'
  • Download Code