Update documentation
This commit is contained in:
parent
447d0e0e8b
commit
2e80d64aae
1 changed files with 12 additions and 0 deletions
12
README.md
12
README.md
|
|
@ -116,3 +116,15 @@ Perl and Javascript use.
|
||||||
`"12".split(re"(\d)") == @["", "1", "", "2", ""]`.
|
`"12".split(re"(\d)") == @["", "1", "", "2", ""]`.
|
||||||
|
|
||||||
[proc-split]: #splitstring-regex-seqstring
|
[proc-split]: #splitstring-regex-seqstring
|
||||||
|
|
||||||
|
#### `replace(string, Regex, sub): string`
|
||||||
|
|
||||||
|
Replaces each match of Regex in the string with `sub`. If `sub` is a `proc
|
||||||
|
(RegexMatch): string`, then it is executed with each match and the return value
|
||||||
|
is the replacement value.
|
||||||
|
|
||||||
|
If `sub` is a string, then each match is replaced with that string, where the
|
||||||
|
captures are accessable as `$1`, `$2`, and so on. A literal `$` can be added by
|
||||||
|
doubling up like so: `$$`.
|
||||||
|
|
||||||
|
[proc-replace]: #replacestring-regex-sub-string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue