term-previous-matching-input-string-position

term-previous-matching-input-string-position is a compiled Lisp function in `term.el'.

(term-previous-matching-input-string-position REGEXP ARG &optional START)

Return the index matching REGEXP ARG places along the input ring.
Moves relative to START, or `term-input-ring-index'.