mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 03:02:31 +00:00
Add findAllStr
This commit is contained in:
@@ -362,6 +362,11 @@ proc find*(str: string, pattern: Regex, start = 0, endpos = -1): Option[RegexMat
|
||||
proc findAll*(str: string, pattern: Regex, start = 0, endpos = -1): seq[RegexMatch] =
|
||||
accumulateResult(str.findIter(pattern, start, endpos))
|
||||
|
||||
proc findAllStr*(str: string, pattern: Regex, start = 0, endpos = -1): seq[string] =
|
||||
result = @[]
|
||||
for match in str.findIter(pattern, start, endpos):
|
||||
result.add(match.match)
|
||||
|
||||
proc renderBounds(str: string, bounds: Slice[int]): string =
|
||||
result = " " & str & "⫞\n"
|
||||
for i in -1 .. <bounds.a:
|
||||
|
||||
Reference in New Issue
Block a user