Another way using split.
$ perl -E ' > $str = q{~/tmp/hfj/abc/bhd/5009.xmlreal.xml}; > ( $path = ( split m{/}, $str )[ -1 ] ) =~ s{^\d+}{}; > say $path;' .xmlreal.xml $
McDarren's suggestion of File::Basename is probably the safest and most portable though.
Cheers,
JohnGG
In reply to Re: regular expression
by johngg
in thread regular expression
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |