Function: match-end

match-end is a function defined in search.c.

Signature

(match-end SUBEXP)

Documentation

Return position of end of text matched by last search.

SUBEXP, a number, specifies the parenthesized subexpression in the last
  regexp for which to return the start position.
Value is nil if SUBEXPth subexpression didn't match, or there were fewer
  than SUBEXP subexpressions.
SUBEXP zero means the entire text matched by the whole regexp or whole
  string.

Return value is undefined if the last search failed.

Other relevant functions are documented in the regexp group.

View in manual

Probably introduced at or before Emacs version 17.

Shortdoc

;; regexp
(match-end 1)
    e.g. => 3

Aliases

pcomplete-match-end (obsolete since 29.1)

Source Code

// Defined in /usr/src/emacs/src/search.c
{
  return match_limit (subexp, 0);
}