Skip to content

Commit 771e8bf

Browse files
committed
v2.0.0
1 parent 834e424 commit 771e8bf

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ const parens = rregex('g')`\(
5151
'test (balanced ((parens))) ) () ((a)) ((b)'.match(parens);
5252
// → ['(balanced ((parens)))', '()', '((a))', '(b)']
5353

54+
// ----------
5455
// Here's an alternative that matches the same strings
5556
const parens = rregex('g')`\(
5657
( (?> [^\(\)]+ ) | (?R=50) )*
5758
\)`;
58-
// This matches stretches of non-parens in one step with the `+` quantifier,
59-
// and avoids backtracking into sequences of non-parens using an atomic group
60-
// `(?>…)`. Given the nested quantifier, the atomic group is important to avoid
61-
// runaway backtracking when matching long strings with unbalanced parens.
62-
// Atomic groups are provided by the base `regex` package
59+
// This matches sequences of non-parens in one step with the `+` quantifier,
60+
// and avoids backtracking into these sequences by using an atomic group
61+
// `(?>…)`. Given the nested quantifier, the atomic group is important here.
62+
// It avoids runaway backtracking when matching long strings with unbalanced
63+
// parens. Atomic groups are provided by the base `regex` package
6364
```
6465

6566
Match palindromes:
@@ -105,7 +106,7 @@ regex({flags: 'i', postprocessors: [recursion]})`a(?R=2)?b`;
105106

106107
## Install and use
107108

108-
```bash
109+
```sh
109110
npm install regex-recursion
110111
```
111112

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "regex-recursion",
3-
"version": "1.0.0",
4-
"description": "Recursive matching extension for tag regex",
3+
"version": "2.0.0",
4+
"description": "Recursive matching extension for the regex package",
55
"author": "Steven Levithan",
66
"license": "MIT",
77
"type": "module",

0 commit comments

Comments
 (0)