Next: Extracting information, Up: CL-PPCRE Basic Operations [Contents][Index]
scan
The scan
function tries to match the given pattern and on success
returns four multiple-values values:
Returns ‘NIL’ on failure.
create-scanner
A regular expression pattern can be compiled with the
create-scanner
function call. A “scanner” will be created that can be used
by other functions.
(let ((ptrn (ppcre:create-scanner "(a)*b"))) (ppcre:scan ptrn "xaaabd"))
will yield the same results as:
(ppcre:scan "(a)*b" "xaaabd")
but will require less time for repeated scan
calls as parsing the
expression and compiling it is done only once.