parent
613829f7a4
commit
c5a72ebddd
2 changed files with 14 additions and 0 deletions
12
tests/misc/t16541.nim
Normal file
12
tests/misc/t16541.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
discard """
|
||||
action: "reject"
|
||||
|
||||
"""
|
||||
|
||||
import strutils, sugar, nre
|
||||
|
||||
proc my_replace*(s: string, r: Regex, by: string | (proc (match: string): string)): string =
|
||||
nre.replace(s, r, by)
|
||||
|
||||
discard my_replace("abcde", re"[bcd]", match => match.to_upper) == "aBCDe"
|
||||
discard my_replace("abcde", re"[bcd]", (match: string) => match.to_upper) == "aBCDe"
|
||||
Loading…
Add table
Add a link
Reference in a new issue