Original OP use strict; use warnings; my $folder_path = "/aboutiso/corp_gov/bod/agendas/2010/"; my $try = "index.html"; my $test = "$folder_path/$try"; $folder_path =~ s#/\w+/[^/]*.\w+$##; print "folderpath: $folder_path\n";gives me incorrect output: /aboutiso/corp_gov
I'm trying to print /aboutiso/corp_gov/bod/agendas
No, it doesn't print that.
Based on what you posted, you want to remove the trailing "/2010/", so
$folder_path =~ s{/[^/]*/\z}{};
In reply to Re: Regex output incorrect
by ikegami
in thread Regex output incorrect
by begood321
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |