aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/text.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/text.md b/docs/text.md
index 9d5cc973..8131d255 100644
--- a/docs/text.md
+++ b/docs/text.md
@@ -870,20 +870,20 @@ The text with occurrences of the pattern replaced.
**Example:**
```tomo
->> "Hello world":replace("world", "there")
+>> "Hello world":replace($/world/, "there")
= "Hello there"
->> "Hello world":replace("{id}", "xxx")
+>> "Hello world":replace($/{id}/, "xxx")
= "xxx xxx"
->> "Hello world":replace("{id}", "\0")
+>> "Hello world":replace($/{id}/, "\0")
= "(Hello) (world)"
->> "Hello world":replace("{id} {id}", "just \2")
+>> "Hello world":replace($/{id} {id}/, "just \2")
= "just world"
->> "some (parenthesized (with inner parens) text) here":replace("(?)", "non-\1")
-= "some non-parenthesized (with inner parens) text here"
+>> " foo(x, fn(), y) ":replace($/foo(?)/, "baz(\1)")
+= " baz(x, fn(), y) "
```
---