Docs edit, noted double backslash requirement for some regex operators (#1361)
This commit is contained in:
1 file changed
+3
-2
@@ -205,10 +205,11 @@ title('aBc') => 'Abc'
|
||||
### `replace(string, regex, repl?); replace_first(string, regex, repl?)`
|
||||
|
||||
Replaces all, or first occurence of a regular expression in the string with `repl` expression,
|
||||
or nothing, if not specified
|
||||
or nothing, if not specified. To use escape characters (`\(`,`\+`,...), metacharacters (`\d`,`\w`,...), or position anchors (`\b`,`\z`,...) in your regular expression, use two backslashes.
|
||||
|
||||
<pre>
|
||||
replace('abbccddebfg','b+','z') // => azccddezfg
|
||||
replace('abbccddebfg','\\w$','z') // => abbccddebfz
|
||||
replace_first('abbccddebfg','b+','z') // => azccddebfg
|
||||
</pre>
|
||||
|
||||
@@ -428,4 +429,4 @@ not present, and default expression is provided, sets a new value to be associat
|
||||
### `system_variable_set(key, new_value)`
|
||||
|
||||
Returns the variable from the system shared key-value storage keyed with a `key` value, and sets a new
|
||||
mapping for the key
|
||||
mapping for the key
|
||||
Reference in new issue
Block a user