Skip to content

Commit a4e3180

Browse files
authored
Merge pull request #52 from jtomaszewski/patch-1
docs: Add info about improper RegExp replace (that has no capturing group)
2 parents 664273c + 076404b commit a4e3180

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)