Update documentation

This commit is contained in:
Flaviu Tamas
2015-01-17 22:49:34 -05:00
parent 447d0e0e8b
commit 2e80d64aae

View File

@@ -116,3 +116,15 @@ Perl and Javascript use.
`"12".split(re"(\d)") == @["", "1", "", "2", ""]`.
[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