33.15. Perl Compatible Regular Expressions

This is an interface to Perl Compatible Regular Expressions.

When this module is present, *FEATURES* contains the symbol :PCRE.

PCRE module API

(PCRE:PCRE-VERSION)
Return version information as 4 values: descriptive STRING; 2 FIXNUMs: major and minor numbers; date STRING.
(PCRE:PCRE-CONFIG type)

Return some information about the PCRE build configuration. type is one of

:UTF8
:NEWLINE
:LINK-SIZE
:POSIX-MALLOC-THRESHOLD
:MATCH-LIMIT
:STACKRECURSE
:UNICODE-PROPERTIES
:MATCH-LIMIT-RECURSION
:BSR
(PCRE:PCRE-COMPILE string &KEY :STUDY :IGNORE-CASE :MULTILINE :DOTALL :EXTENDED :ANCHORED :DOLLAR-ENDONLY :EXTRA :NOTBOL :NOTEOL :UNGREEDY :NOTEMPTY :NO-AUTO-CAPTURE)
Compile a pattern, optionally study it.
(PCRE:PATTERN-INFO pattern &OPTIONAL request)

Return some information about the pattern, such as

:OPTIONS
:SIZE
:CAPTURECOUNT
:BACKREFMAX
:FIRSTBYTE
:FIRSTTABLE
:LASTLITERAL
:NAMEENTRYSIZE
:NAMECOUNT
:NAMETABLE
:STUDYSIZE
:OKPARTIAL
:JCHANGED
:HASCRORLF
:MINLENGTH
(PCRE:PCRE-NAME-TO-INDEX pattern name)
Convert the name of the sub-pattern to an index in the return vector.
(PCRE:PCRE-EXEC pattern string &KEY :WORK-SPACE :DFA :BOOLEAN :OFFSET :ANCHORED :NOTBOL :NOTEOL :NOTEMPTY :PARTIAL :DFA-SHORTEST :DFA-RESTART :FIRSTLINE :DUPNAMES :NEWLINE-CR :NEWLINE-LF :NEWLINE-CRLF :NEWLINE-ANY :NEWLINE-ANYCRLF :BSR-ANYCRLF :BSR-UNICODE :JAVASCRIPT-COMPAT :NO-START-OPTIMIZE :NO-START-OPTIMISE :PARTIAL-HARD :NOTEMPTY-ATSTART)

Execute the compiled pattern against the string at the given offset with the given options. Returns NIL if no matches or a VECTOR of LENGTH CAPTURECOUNT+1 of PCRE:MATCH structures, unless :BOOLEAN was non-NIL, in which case return T as an indicator of success, but do not allocate anything.

:DFA argument determines whether pcre_dfa_exec is used instead of pcre_exec (PCRE v6 and better).

:WORK-SPACE is only used for :DFA and defaults to 20.

(PCRE:MATCH-START match)
(PCRE:MATCH-END match)
Return the start and end of the match. SETF-able.
(PCRE:MATCH-SUBSTRING match string)
Return the substring of string bounded by match.
(PCRE:MATCH-STRINGS return-vector string)
Return all substrings for all matches found by PCRE:PCRE-EXEC.
(PCRE:MATCH-STRING return-vector which string &OPTIONAL pattern)
Return the substring that matches the given sub-pattern. If which is a name of the sub-pattern (as opposed to its number), pattern must be supplied.
(PCRE:PCRE-MATCHER pattern)
A valid value for CUSTOM:*APROPOS-MATCHER*.

These notes document CLISP version 2.49.93+Last modified: 2018-02-19