[std/re] fix findBounds and find procs (#18028)
* [std/re] make interface consistent * tiny * revert
This commit is contained in:
parent
06d50bfd4c
commit
c0e8199acc
1 changed files with 2 additions and 2 deletions
|
|
@ -171,7 +171,7 @@ proc findBounds*(s: string, pattern: Regex, matches: var openArray[string],
|
||||||
|
|
||||||
proc findBounds*(buf: cstring, pattern: Regex,
|
proc findBounds*(buf: cstring, pattern: Regex,
|
||||||
matches: var openArray[tuple[first, last: int]],
|
matches: var openArray[tuple[first, last: int]],
|
||||||
start = 0, bufSize = 0): tuple[first, last: int] =
|
start = 0, bufSize: int): tuple[first, last: int] =
|
||||||
## returns the starting position and end position of `pattern` in `buf`
|
## returns the starting position and end position of `pattern` in `buf`
|
||||||
## (where `buf` has length `bufSize` and is not necessarily `'\0'` terminated),
|
## (where `buf` has length `bufSize` and is not necessarily `'\0'` terminated),
|
||||||
## and the captured substrings in the array `matches`.
|
## and the captured substrings in the array `matches`.
|
||||||
|
|
@ -290,7 +290,7 @@ proc match*(buf: cstring, pattern: Regex, matches: var openArray[string],
|
||||||
result = matchLen(buf, pattern, matches, start, bufSize) != -1
|
result = matchLen(buf, pattern, matches, start, bufSize) != -1
|
||||||
|
|
||||||
proc find*(buf: cstring, pattern: Regex, matches: var openArray[string],
|
proc find*(buf: cstring, pattern: Regex, matches: var openArray[string],
|
||||||
start = 0, bufSize = 0): int =
|
start = 0, bufSize: int): int =
|
||||||
## returns the starting position of `pattern` in `buf` and the captured
|
## returns the starting position of `pattern` in `buf` and the captured
|
||||||
## substrings in the array `matches`. If it does not match, nothing
|
## substrings in the array `matches`. If it does not match, nothing
|
||||||
## is written into `matches` and `-1` is returned.
|
## is written into `matches` and `-1` is returned.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue