Skip to content

Commit 076404b

Browse files
authored
docs: Add info about improper RegExp replace (that has no capturing group)
1 parent 664273c commit 076404b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

readme.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ The string or array you would like to do replacement on.
123123

124124
Type: `regexp|string`
125125

126-
The string or RegExp you would like to replace within `string`. Note that when using a `RegExp` you **MUST** include a matching group.
126+
The string or RegExp you would like to replace within `string`.
127+
128+
**NOTE:** When using a `RegExp` you **MUST** include a capturing group. (`/(hey)/g` is ok, `/hey/g` is not.)
127129

128130
Example: Replace all occurrences of `'hey'` with `<span>hey</span>`
129131

0 commit comments

Comments
 (0)