Function: comint-previous-matching-input

Search backwards through input history for match for REGEXP.
(Previous history elements are earlier commands.)
With prefix argument N, search for Nth previous match.
If N is negative, find the next or Nth next match.
(fn REGEXP N)