Add findAllStr
This commit is contained in:
parent
1652cdbaff
commit
e0cdad635b
1 changed files with 5 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue