- List.filter (fun (rex, _, l, _) -> Pcre.pmatch ~rex uri)
- (Lazy.force (prefix_map ())) in
+ HExtlib.filter_map
+ (fun (rex, _, l, _ as entry) ->
+ try
+ let got = Pcre.extract ~full_match:true ~rex uri in
+ Some (entry, String.length got.(0))
+ with Not_found -> None)
+ (Lazy.force (prefix_map ()))
+ in