You have had your question answered. For reference, an answer to your title "match only last character of a kind" is to use a greedy match:
my ($dir, $name) = $path =~ m|(.*/)(.*)|;
In reply to Re: match only last character of a kind
by GrandFather
in thread match only last character of a kind
by duc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |