diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2007-05-02 11:13:14 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-05-02 11:13:14 +0000 |
commit | e4cdad9700342b4dbc1837307580134eee274f33 (patch) | |
tree | c4ee72ae489fd10b53a25fdb28b2659f4a018830 /Doc | |
parent | 7f03c3d851c571d86d18c701d882c13ad5d06c6c (diff) | |
download | zsh-e4cdad9700342b4dbc1837307580134eee274f33.tar.gz zsh-e4cdad9700342b4dbc1837307580134eee274f33.tar.xz zsh-e4cdad9700342b4dbc1837307580134eee274f33.zip |
unposted: regex fix-ups: missing doc file plus pointer fixes
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/Zsh/mod_regex.yo | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Doc/Zsh/mod_regex.yo b/Doc/Zsh/mod_regex.yo new file mode 100644 index 000000000..08e92ab9f --- /dev/null +++ b/Doc/Zsh/mod_regex.yo @@ -0,0 +1,27 @@ +COMMENT(!MOD!zsh/regex +Interface to the POSIX regex library. +!MOD!) +cindex(regular expressions) +cindex(regex) +The tt(zsh/regex) module makes available the following test condition: +startitem() +findex(regex-match) +item(var(expr) tt(-regex-match) var(regex))( +Matches a string against a POSIX extended regular expression. +The matched portion of the string will normally be placed in the tt(MATCH) +variable. If there are any capturing parentheses within the regex, then +the tt(match) array variable will contain those. + +For example, + +example([[ alphabetical -regex-match ^a+LPAR()[^a]PLUS()+RPAR()a+LPAR()[^a]+PLUS()+RPAR()a ]] && +print -l $MATCH X $match) + +If the option tt(REMATCH_PCRE) is not set, then the tt(=~) operator will +automatically load this module as needed and will invoke the +tt(-regex-match) operator. + +If tt(BASH_REMATCH) is set, then the array tt(BASH_REMATCH) will be set +instead of tt(MATCH) and tt(match). +) +enditem() |