1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-19 03:31:14 +02:00
zsh/Doc/Zsh/mod_pcre.yo
Clint Adams befd90b847 * 19631: Doc/Zsh/mod_pcre.yo, Src/Modules/pcre.c: avoid segfault
when pcre_study is called before pcre_compile; documentation on
      pcre_compile options.
2004-03-16 15:14:30 +00:00

34 lines
1.1 KiB
Text

COMMENT(!MOD!zsh/pcre
Interface to the PCRE library.
!MOD!)
cindex(regular expressions, perl-compatible)
The tt(zsh/pcre) module makes some commands available as builtins:
startitem()
findex(pcre_compile)
item(tt(pcre_compile) [ tt(-aimx) ] var(PCRE))(
Compiles a perl-compatible regular expression.
Option tt(-a) will force the pattern to be anchored.
Option tt(-i) will compile a case-insensitive pattern.
Option tt(-m) will compile a multi-line pattern; that is,
tt(^) and tt($) will match newlines within the pattern.
Option tt(-x) will compile an extended pattern, wherein
whitespace and tt(#) comments are ignored.
)
findex(pcre_study)
item(tt(pcre_study))(
Studies the previously-compiled PCRE which may result in faster
matching.
)
findex(pcre_match)
item(tt(pcre_match) [ tt(-a) var(arr) ] var(string))(
Returns successfully if tt(string) matches the previously-compiled
PCRE.
If the expression captures substrings within parentheses,
tt(pcre_match) will set the array var($match) to those
substrings, unless the tt(-a) option is given, in which
case it will set the array var(arr).
)
enditem()