functor (Text : UnicodeString.Type->
  sig
    type text = Text.t
    type index = Text.index
    type compiled_regexp
    module SubText :
      sig
        type t
        val get : t -> int -> UChar.t
        val init : int -> (int -> UChar.t) -> t
        val length : t -> int
        type index
        val look : t -> index -> UChar.t
        val nth : t -> int -> index
        val first : t -> index
        val last : t -> index
        val next : t -> index -> index
        val prev : t -> index -> index
        val move : t -> index -> int -> index
        val out_of_range : t -> index -> bool
        val compare_index : t -> index -> index -> int
        val iter : (UChar.t -> unit) -> t -> unit
        val compare : t -> t -> int
        module Buf :
          sig
            type buf
            val create : int -> buf
            val contents : buf -> t
            val clear : buf -> unit
            val reset : buf -> unit
            val add_char : buf -> UChar.t -> unit
            val add_string : buf -> t -> unit
            val add_buffer : buf -> buf -> unit
          end
        type ur_text = text
        type ur_index = index
        val refer : ur_text -> ur_index -> ur_index -> t
        val excerpt : t -> ur_text
        val context : t -> ur_text * ur_index * ur_index
        val ur_index_of : t -> index -> ur_index
      end
    val compile : regexp -> compiled_regexp
    val regexp_match :
      ?sem:match_semantics ->
      compiled_regexp -> text -> index -> SubText.t option array option
    val string_match : compiled_regexp -> text -> index -> bool
    val search_forward :
      ?sem:match_semantics ->
      compiled_regexp -> text -> index -> SubText.t option array option
  end