about summary refs log tree commit diff
path: root/Doc/Zsh
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-04-06 18:44:01 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-04-06 18:44:01 +0000
commitd2330ba0554b09a3f942a921acfbbabcf6466bef (patch)
tree2bf4a6598e69a8c62b73e1293172d74f91a3cf64 /Doc/Zsh
parent181811bf80eaa7c11e3d465c33ce5c9ed4e0415d (diff)
downloadzsh-d2330ba0554b09a3f942a921acfbbabcf6466bef.tar.gz
zsh-d2330ba0554b09a3f942a921acfbbabcf6466bef.tar.xz
zsh-d2330ba0554b09a3f942a921acfbbabcf6466bef.zip
10547: (#s) and (#e) pattern assertions
Diffstat (limited to 'Doc/Zsh')
-rw-r--r--Doc/Zsh/expn.yo11
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index 9d2f035c8..172949176 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -1299,6 +1299,17 @@ item(tt(a)var(num))(
 Approximate matching: var(num) errors are allowed in the string matched by
 the pattern.  The rules for this are described in the next subsection.
 )
+item(tt(s), tt(e))(
+Unlike the other flags, these have only a local effect, and each must
+appear on its own:  `tt((#s))' and `tt((#e))' are the only valid forms.
+The `tt((#s))' flag succeeds only at the start of the test string, and the
+`tt((#e))' flag succeeds only at the end of the test string; they
+correspond to `tt(^)' and `tt($)' in standard regular expressions.  They
+are useful for matching path segments in patterns.  For example,
+`tt(*((#s)|/)test((#e)|/)*)' matches a path segment `tt(test)' in any of
+the following strings: tt(test), tt(test/at/start), tt(at/end/test),
+tt(in/test/middle).
+)
 enditem()
 
 For example, the test string tt(fooxx) can be matched by the pattern