let string_of_regexp (regexp, _) =
  let escape = choose_escape regexp ['/''@'',''%'in
  if escape = '/' then
    sprintf "/%s/" regexp
  else
    sprintf "@%c%s%c" escape regexp escape