In your regex, the the dot matches any character, and in particular, it matches the slash before 2010. That's the first character that you don't want, so one way to get the correct output is to capture everything up to there:
I replaced the dot with a slash since that's the first character I don't want.use strict; use warnings; my $folder_path = "/aboutiso/corp_gov/bod/agendas/2010"; $folder_path =~ s#((/\w+)+)/\w+$#$1#; print "folderpath: $folder_path\n";
In reply to Re: Regex output incorrect
by jakeease
in thread Regex output incorrect
by begood321
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |