mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 19:52:36 +00:00
Merge pull request #2262 from jobe2015/re-replace-doku
Fixed examples in the documentation of module re
This commit is contained in:
@@ -291,7 +291,7 @@ proc replace*(s: string, sub: Regex, by = ""): string =
|
||||
## accessed in `by`. Examples:
|
||||
##
|
||||
## .. code-block:: nim
|
||||
## "var1=key; var2=key2".replace(re"(\w+)'='(\w+)")
|
||||
## "var1=key; var2=key2".replace(re"(\w+)=(\w+)")
|
||||
##
|
||||
## Results in:
|
||||
##
|
||||
@@ -313,7 +313,7 @@ proc replacef*(s: string, sub: Regex, by: string): string =
|
||||
## with the notation ``$i`` and ``$#`` (see strutils.`%`). Examples:
|
||||
##
|
||||
## .. code-block:: nim
|
||||
## "var1=key; var2=key2".replacef(re"(\w+)'='(\w+)", "$1<-$2$2")
|
||||
## "var1=key; var2=key2".replacef(re"(\w+)=(\w+)", "$1<-$2$2")
|
||||
##
|
||||
## Results in:
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user