Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq authored and krux02 committed Oct 15, 2018
1 parent 8e241e5 commit 6f498a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/impure/re.nim
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ proc replace*(s: string, sub: Regex, by = ""): string =
## "; "
result = ""
var prev = 0
while true:
while prev < s.len:
var match = findBounds(s, sub, prev)
if match.first < 0: break
add(result, substr(s, prev, match.first-1))
Expand All @@ -453,7 +453,7 @@ proc replacef*(s: string, sub: Regex, by: string): string =
result = ""
var caps: array[MaxSubpatterns, string]
var prev = 0
while true:
while prev < s.len:
var match = findBounds(s, sub, caps, prev)
if match.first < 0: break
add(result, substr(s, prev, match.first-1))
Expand Down

0 comments on commit 6f498a3

Please sign in to comment.