summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorFlaviu Tamas <tamasflaviu@gmail.com>2015-05-26 19:48:58 -0400
committerFlaviu Tamas <tamasflaviu@gmail.com>2015-06-07 13:13:04 -0400
commit15ef227c48417819fab86c86103565e2a324ad92 (patch)
tree01b5f1f0d559661975d7c7e79857c5ee0ac907ce /lib
parentdc60a51e1545d8c73bc9415d1045864b72cfda0b (diff)
downloadNim-15ef227c48417819fab86c86103565e2a324ad92.tar.gz
Adjust re for nre's inclusive bounds
Diffstat (limited to 'lib')
-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] =