Handbook
Glossary
PCRE2 binding
The
pcre2
vocab implements a simple binding for libpcre2, enabling rich regular expression support for Factor applications.
Precompiling and optimizing a regular expression:
<pcre2>
( expr -- pcre2 )
Once compiled, a
pcre2
is a
Deterministic resource disposal
disposable and should be released with
dispose
(or used inside
with-disposal
).
Searching, testing, and splitting:
findall
( subject obj -- matches )
matches?
( subject obj -- ? )
split
( subject obj -- strings )
Querying a compiled pattern and the library:
has-option?
( pcre2 option -- ? )
version
( -- f )
Examples
USING: pcre2 ; "foobar" "\\w" findall
Notes
Regular expressions are by default utf8 and unicode aware.