@@ -27,7 +27,7 @@ For all of the following functions, argument `expression` is the target string,
27
27
28
28
* Arguments: ` expression, needle, replacement, [context] ` *
29
29
30
- Replaces all unescaped instances of a regex pattern in the given context, using a replacement string or callback function.
30
+ Replaces all unescaped instances of a regex pattern in the given context, using a replacement string or function.
31
31
32
32
<details >
33
33
<summary >Examples with a replacement string</summary >
@@ -46,7 +46,7 @@ replaceUnescaped(str, '\\.', '@', Context.CHAR_CLASS);
46
46
Details for the ` replacement ` argument:
47
47
48
48
- If a string is provided, it's used literally without special handling for backreferences, etc.
49
- - If a callback function is provided, it receives two arguments:
49
+ - If a function is provided, it receives two arguments:
50
50
1 . The match object (which includes ` groups ` , ` index ` , etc.).
51
51
2 . An object with extended details (` context ` and ` negated ` ) about where the match was found.
52
52
@@ -66,9 +66,7 @@ Checks whether an unescaped instance of a regex pattern appears in the given con
66
66
67
67
* Arguments: ` expression, needle, callback, [context] ` *
68
68
69
- Runs a callback function for each unescaped instance of a regex pattern in the given context.
70
-
71
- Callback functions receive two arguments:
69
+ Runs a function for each unescaped match of a regex pattern in the given context. The function receives two arguments:
72
70
73
71
1 . The match object (which includes ` groups ` , ` index ` , etc.).
74
72
2 . An object with extended details (` context ` and ` negated ` ) about where the match was found.
0 commit comments