summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nre.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nre.nim b/src/nre.nim
index d907cae62..9e1a6a64e 100644
--- a/src/nre.nim
+++ b/src/nre.nim
@@ -417,7 +417,7 @@ proc split*(str: string, pattern: Regex, maxSplit = -1): seq[string] =
       # if there are captures, include them in the result
       result.add(cap)
 
-    if splits == maxSplit:
+    if splits == maxSplit - 1:
       break
 
   # last match: Each match takes the previous substring,