read-regexp
read-regexp is a compiled Lisp function in `replace.el
'.
(read-regexp PROMPT &optional DEFAULTS HISTORY)
Read and return a regular expression as a string.
Prompt with the string PROMPT. If PROMPT ends in ":" (followed by
optional whitespace), use it as-is. Otherwise, add ": " to the end,
possibly preceded by the default result (see below).
The optional argument DEFAULTS can be either: nil, a string, a list
of strings, or a symbol. We use DEFAULTS to construct the default
return value in case of empty input.
If DEFAULTS is a string, we use it as-is.
If DEFAULTS is a list of strings, the first element is the
default return value, but all the elements are accessible
using the history command M-n.
If DEFAULTS is a non-nil symbol, then if `read-regexp-defaults-function'
is non-nil, we use that in place of DEFAULTS in the following:
If DEFAULTS is the symbol `regexp-history-last', we use the first
element of HISTORY (if specified) or `regexp-history'.
If DEFAULTS is a function, we call it with no arguments and use
what it returns, which should be either nil, a string, or a list of strings.
We append the standard values from `read-regexp-suggestions' to DEFAULTS
before using it.
If the first element of DEFAULTS is non-nil (and if PROMPT does not end
in ":", followed by optional whitespace), we add it to the prompt.
The optional argument HISTORY is a symbol to use for the history list.
If nil, uses `regexp-history'.