    sig
      type regexp
      val regexp : string -> Str.regexp
      val regexp_case_fold : string -> Str.regexp
      val quote : string -> string
      val regexp_string : string -> Str.regexp
      val regexp_string_case_fold : string -> Str.regexp
      external string_match : Str.regexp -> string -> int -> bool
        = "str_string_match"
      external search_forward : Str.regexp -> string -> int -> int
        = "str_search_forward"
      external search_backward : Str.regexp -> string -> int -> int
        = "str_search_backward"
      external string_partial_match : Str.regexp -> string -> int -> bool
        = "str_string_partial_match"
      val matched_string : string -> string
      val match_beginning : unit -> int
      val match_end : unit -> int
      val matched_group : int -> string -> string
      val group_beginning : int -> int
      val group_end : int -> int
      val global_replace : Str.regexp -> string -> string -> string
      val replace_first : Str.regexp -> string -> string -> string
      val global_substitute :
        Str.regexp -> (string -> string) -> string -> string
      val substitute_first : Str.regexp -> (string -> string) -> string -> string
      val replace_matched : string -> string -> string
      val split : Str.regexp -> string -> string list
      val bounded_split : Str.regexp -> string -> int -> string list
      val split_delim : Str.regexp -> string -> string list
      val bounded_split_delim : Str.regexp -> string -> int -> string list
      type split_result = Text of string | Delim of string
      val full_split : Str.regexp -> string -> Str.split_result list
      val bounded_full_split :
        Str.regexp -> string -> int -> Str.split_result list
      val string_before : string -> int -> string
      val string_after : string -> int -> string
      val first_chars : string -> int -> string
      val last_chars : string -> int -> string
    end