aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authormryouse2022-07-15 00:57:34 +0000
committermryouse2022-07-15 00:57:34 +0000
commitb3bb6d85245ac5d2b9b450965301e99604d49eb3 (patch)
treef4d3f2be137baf76441616eaf612c2162d191528 /libs
parent91098f7f4e4a57d1163b3d8831d6e00548021b72 (diff)
bugfix: empty pattern is always true
Diffstat (limited to 'libs')
-rw-r--r--libs/regex.neb4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/regex.neb b/libs/regex.neb
index 8919232..a4460ec 100644
--- a/libs/regex.neb
+++ b/libs/regex.neb
@@ -2,7 +2,9 @@
; for doing regex matches
(func match? :bool (pattern :string text :string)
- (.search pattern text))
+ (if (eq? 0 (length pattern))
+ #true
+ (.search pattern text)))
(func .match-one :bool (left right)
(in? left (list "" "." right)))