diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 20:48:11 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 20:48:11 -0400 |
| commit | c14ed3e3e71535e73352ead0ecaedaa46dc5aeee (patch) | |
| tree | 53b1c82def67ef82f57a10337621df4322056c98 /test/text.tm | |
| parent | 3c2c1a308b1e0ff24bba4d407b4d04e9ef496a94 (diff) | |
Add Text.replace_all({Pattern:Text}) and tweak API for replacement to
support placeholders
Diffstat (limited to 'test/text.tm')
| -rw-r--r-- | test/text.tm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/text.tm b/test/text.tm index 52c74afd..d75a56a7 100644 --- a/test/text.tm +++ b/test/text.tm @@ -227,4 +227,12 @@ func main(): >> $/$malicious/ = $/{1{}xxx}/ + >> "Hello":replace($/{lower}/, "(@)", $/@/) + = "H(ello)" + + >> " foo(xyz) foo(yyy) foo(z()) ":replace_chain([$/foo(/, $/?/, $/)/], ["baz[", "@", "]"], $/@/) + = " baz[xyz] baz[yyy] baz[z()] " + + >> "<tag>":replace_all({$/</:"<", $/>/:">"}) + = "<tag>" |
