33.14. Perl Compatible Regular Expressions
Prev | Chapter 33. Extensions Implemented as Modules | Next

## 33.14. 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 3 values: descriptive `STRING` and 2 `FIXNUM`s: major and minor numbers.
`(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`

`(PCRE:PCRE-COMPILE `string` `&KEY` :STUDY :IGNORE-CASE :MULTILINE :DOTALL :EXTENDED :ANCHORED :DOLLAR-ENDONLY :EXTRA :NOTBOL :NOTEOL :UNGREADY :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`

`(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)`

  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.45 | Last modified: 2008-05-14

Enter your search termsSubmit search form
Webclisp.cons.orgclisp.podval.orgwww.lisp.org

Prev | Up | Next
33.13. Netica Interface | Home | 33.15. The Wildcard Module