mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 04:02:41 +00:00
Merge pull request #9151 from flaviut/fix-9053
Fix option documentation in nre (fixes #9053)
This commit is contained in:
@@ -151,18 +151,18 @@ type
|
||||
## the whole match is returned. If the given capture was not matched,
|
||||
## ``nil`` is returned.
|
||||
##
|
||||
## - ``"abc".match(re"(\w)").captures[0] == "a"``
|
||||
## - ``"abc".match(re"(?<letter>\w)").captures["letter"] == "a"``
|
||||
## - ``"abc".match(re"(\w)\w").captures[-1] == "ab"``
|
||||
## - ``"abc".match(re"(\w)").get.captures[0] == "a"``
|
||||
## - ``"abc".match(re"(?<letter>\w)").get.captures["letter"] == "a"``
|
||||
## - ``"abc".match(re"(\w)\w").get.captures[-1] == "ab"``
|
||||
##
|
||||
## ``captureBounds[]: Option[HSlice[int, int]]``
|
||||
## gets the bounds of the given capture according to the same rules as
|
||||
## the above. If the capture is not filled, then ``None`` is returned.
|
||||
## The bounds are both inclusive.
|
||||
##
|
||||
## - ``"abc".match(re"(\w)").captureBounds[0] == 0 .. 0``
|
||||
## - ``"abc".match(re"").captureBounds[-1] == 0 .. -1``
|
||||
## - ``"abc".match(re"abc").captureBounds[-1] == 0 .. 2``
|
||||
## - ``"abc".match(re"(\w)").get.captureBounds[0].get == 0 .. 0``
|
||||
## - ``"abc".match(re"").get.captureBounds[-1].get == 0 .. -1``
|
||||
## - ``"abc".match(re"abc").get.captureBounds[-1].get == 0 .. 2``
|
||||
##
|
||||
## ``match: string``
|
||||
## the full text of the match.
|
||||
|
||||
Reference in New Issue
Block a user