diff --git a/lib/impure/re.nim b/lib/impure/re.nim index 57dc3a3138..ef02a3b1d3 100644 --- a/lib/impure/re.nim +++ b/lib/impure/re.nim @@ -239,8 +239,9 @@ template `=~` *(s: string, pattern: TRegEx): expr = ## else: ## echo("syntax error") ## + bind maxSubPatterns when not definedInScope(matches): - var matches {.inject.}: array[0..re.maxSubPatterns-1, string] + var matches {.inject.}: array[0..maxSubPatterns-1, string] match(s, pattern, matches) # ------------------------- more string handling ------------------------------