$ perl -wle '"foo/bar" =~ m!^/*(.*[^/])/*$! and print "Aristotle is wrong."' Aristotle is wrong.