diff options
| author | mryouse | 2022-07-15 00:57:34 +0000 |
|---|---|---|
| committer | mryouse | 2022-07-15 00:57:34 +0000 |
| commit | b3bb6d85245ac5d2b9b450965301e99604d49eb3 (patch) | |
| tree | f4d3f2be137baf76441616eaf612c2162d191528 /libs/regex.neb | |
| parent | 91098f7f4e4a57d1163b3d8831d6e00548021b72 (diff) | |
bugfix: empty pattern is always true
Diffstat (limited to 'libs/regex.neb')
| -rw-r--r-- | libs/regex.neb | 4 |
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))) |
