if ($subpath =~ m:^\Q$target\E(/|$):) {