cs-pcre2 - Chez Scheme bindings for PCRE2.

git clone https://benconnors.ca/git-repos/cs-pcre2

About | Log | Files | Refs

README.md (1152B) - raw


      1 # PCRE2 Bindings for Chez Scheme
      2 This library provides Chez Scheme bindings for (a subset of) PCRE2 (UTF-8). 
      3 
      4 ## Functions
      5 
      6 ```
      7 (pcre2-compile pattern options)
      8 ```
      9 Compile the given string pattern for use with `pcre2-match`. The compiled code allocated by PCRE2 is automatically freed when the returned object becomes inaccessible from Scheme.
     10 
     11 ```
     12 (pcre2-match pattern string offset options)
     13 ```
     14 Match the compiled `pattern` to the passed `string` starting at `offset`. Returns a match data block object that may be manipulated using the following functions, or `#f` if no match was made.
     15 
     16 ```
     17 (pcre2-get-match-count match-data)
     18 ```
     19 Return the number of matches in the match data block.
     20 
     21 ```
     22 (pcre2-get-match-groupcount match-data)
     23 ```
     24 Return the number of groups (possibly null) in the match data block.
     25 
     26 ```
     27 (pcre2-get-match-group match-data n)
     28 ```
     29 Return the `n`-th group in the given match data block. If that group did not match, `#f` is returned.
     30 
     31 ```
     32 (pcre2-get-match-groups match-data)
     33 ```
     34 Return all groups in the given match data block (including null groups) as a list.
     35 
     36 ## Requirements
     37 Ensure that PCRE2 is accessible as `libpcre2-8.so`.