if($mystring =~ m!([^/]+$)!){ #note the $ character added