in reply to Regex output incorrect

What you have after your update (Note: Please mark your OP as Updated) correctly matches (and replaces with the empty string) as follows:
    /  \w+  /   [^/]*   .  \w+        $
    /  bod  /  agendas  /  2010 <end-of-string>

You may want something like:

>perl -wMstrict -le "my $folder_path = '/aboutiso/corp_gov/bod/agendas/2010'; $folder_path =~ s{ / [^/]+ \z }{}xms; print qq{folderpath: '$folder_path'}; " folderpath: '/aboutiso/corp_gov/bod/agendas'

Replies are listed 'Best First'.
Re^2: Regex output incorrect
by begood321 (Novice) on Dec 14, 2010 at 02:44 UTC

    Thanks AMonk, your solution works. I have to study your code to understand solution.

    .