Skip to content

Commit

Permalink
remove i flag from pattern in example (#37119)
Browse files Browse the repository at this point in the history
  • Loading branch information
jolka-ef authored Dec 6, 2024
1 parent 4f59a1b commit b7b0b7c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pattern.test(input2); // false
Imagine you are finding all variable declarations called `foo` or `bar` (because they are bad names). The word may appear in any case, but you know the keyword is always lowercase, so you can do this:

```js
const pattern = /(?:var|let|const) (?i:foo|bar)\b/i;
const pattern = /(?:var|let|const) (?i:foo|bar)\b/;

pattern.test("let foo;"); // true
pattern.test("const BAR = 1;"); // true
Expand Down

0 comments on commit b7b0b7c

Please sign in to comment.