in reply to regexp: match anything but "/"
A negated character class will do it,
if ( m![^/]! ) { # . . . } [download]
After Compline,Zaxo