summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/impure/re.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/impure/re.nim b/lib/impure/re.nim
index a2689a45c..5ee6e7005 100644
--- a/lib/impure/re.nim
+++ b/lib/impure/re.nim
@@ -97,7 +97,7 @@ template returnBounds(): stmt {.immediate, dirty.} =
   return (m.matchBounds.a, <m.matchBounds.b)
 
 template returnLength(): stmt {.immediate, dirty.} =
-  return m.matchBounds.b - m.matchBounds.a
+  return m.matchBounds.b - m.matchBounds.a + 1
 
 proc findBounds*(s: string, pattern: Regex, matches: var openArray[string],
                  start = 0): tuple[first, last: int] =