diff options
Diffstat (limited to 'src/nre.nim')
-rw-r--r-- | src/nre.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nre.nim b/src/nre.nim index e56194fd6..c0c286b0d 100644 --- a/src/nre.nim +++ b/src/nre.nim @@ -445,6 +445,10 @@ proc replace*(str: string, pattern: Regex, subproc: proc (match: RegexMatch): string): string = replaceImpl(str, pattern, subproc(match)) +proc replace*(str: string, pattern: Regex, + subproc: proc (match: string): string): string = + replaceImpl(str, pattern, subproc(match.match)) + proc replace*(str: string, pattern: Regex, sub: string): string = # - 1 because the string numbers are 0-indexed replaceImpl(str, pattern, |