Module Regexp.Last_match

Supplying ~update_last_match:true to a searching function causes Emacs to keep track of the "last match", i.e. the start and end positions of the segments of text found during the search. One can access parts of the last match via the Last_match functions. subexp is one based. (Info-goto-node "(elisp)Match Data")

type t
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val get_exn : unit -> t

(describe-function 'match-data) (Info-goto-node "(elisp)Entire Match Data")

val set : t -> unit

(describe-function 'set-match-data) (Info-goto-node "(elisp)Entire Match Data")

val save : (unit -> 'a) -> 'a

(describe-function 'save-match-data) (Info-goto-node "(elisp)Saving Match Data")

val text_exn : ?⁠subexp:int -> ?⁠text_properties:bool -> unit -> Ecaml.Text.t

text_exn returns the text of the last match, or the subexp'th parenthesized subexpression. (describe-function 'match-string) (Info-goto-node "(elisp)Simple Match Data")

val start_exn : ?⁠subexp:int -> unit -> int

start_exn returns the index of the start of the last match, or the subexp'th parenthesized subexpression. (describe-function 'match-beginning) (Info-goto-node "(elisp)Simple Match Data")

val end_exn : ?⁠subexp:int -> unit -> int

end_exn returns the index after the end of the last match, or the subexp'th parenthesized subexpression. (describe-function 'match-end) (Info-goto-node "(elisp)Simple Match Data")

val replace : string -> unit

(describe-function 'replace-match)

module Private : sig ... end