summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/impure/re.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/impure/re.nim b/lib/impure/re.nim
index 93dc4922d..ff2b70d2d 100644
--- a/lib/impure/re.nim
+++ b/lib/impure/re.nim
@@ -474,7 +474,12 @@ when isMainModule:
   var accum: seq[string] = @[]
   for word in split("00232this02939is39an22example111", re"\d+"):
     accum.add(word)
-  assert(accum == @["this", "is", "an", "example"])
+  assert(accum == @["", "this", "is", "an", "example", ""])
+
+  accum = @[]
+  for word in split("AAA :   : BBB", re"\s*:\s*"):
+    accum.add(word)
+  assert(accum == @["AAA", "", "BBB"])
 
   for x in findAll("abcdef", re"^{.}", 3):
     assert x == "d"