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'
In reply to Re: Regex output incorrect
by AnomalousMonk
in thread Regex output incorrect
by begood321
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |