From 9a804d546cf65c13ab024f02a6c2af12758364d4 Mon Sep 17 00:00:00 2001 From: rv3r <71465541+rv3r@users.noreply.github.com> Date: Mon, 4 Apr 2022 04:26:06 -0400 Subject: [PATCH] Docs edit, noted double backslash requirement for some regex operators (#1361) --- docs/scarpet/language/SystemFunctions.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/scarpet/language/SystemFunctions.md b/docs/scarpet/language/SystemFunctions.md index 88e5c1a0..d158f4e0 100644 --- a/docs/scarpet/language/SystemFunctions.md +++ b/docs/scarpet/language/SystemFunctions.md @@ -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.
 replace('abbccddebfg','b+','z')  // => azccddezfg
+replace('abbccddebfg','\\w$','z')  // => abbccddebfz
 replace_first('abbccddebfg','b+','z')  // => azccddebfg
 
@@ -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 \ No newline at end of file +mapping for the key