summaryrefslogtreecommitdiffhomepage
path: root/README.md
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-05-17 19:57:58 +0200
committerJo-Philipp Wich <jo@mein.io>2021-05-18 13:11:33 +0200
commit5803d8605b84ef362cc7f96f9e523eff5d0d81bc (patch)
treed56d07c53dc1c549ea8b04ce0c3f9517ed5b6300 /README.md
parent29591422d602ec6b5a3808c3dead91cfbcdbbcf0 (diff)
lib: implement wildcard() function
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index b732b1e..210c75c 100644
--- a/README.md
+++ b/README.md
@@ -1138,3 +1138,13 @@ regexp('foo.*bar', 'is'); // equivalent to /foo.*bar/is
regexp('foo.*bar', 'x'); // throws "Type error: Unrecognized flag character 'x'"
regexp('foo.*('); // throws "Syntax error: Unmatched ( or \("
```
+
+#### 6.59. `wildcard(subject, pattern[, nocase])`
+
+Match the given subject against the supplied wildcard (file glob) pattern.
+
+If a truish value is supplied as 3rd argument, case insensitive matching is
+performed. If a non-string value is supplied as subject, it is converted into
+a string before being matched.
+
+Returns `true` when the subject matches the pattern or `false` when not.