From c14ed3e3e71535e73352ead0ecaedaa46dc5aeee Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 3 Sep 2024 20:48:11 -0400 Subject: Add Text.replace_all({Pattern:Text}) and tweak API for replacement to support placeholders --- test/text.tm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/text.tm') 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()] " + + >> "":replace_all({$//:">"}) + = "<tag>" -- cgit v1.2.3