Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid regular expression: /\${[^}]+}/: Incomplete quantifier

See original GitHub issue

After optimization: /\$\{[^}]+\}/u -> /\${[^}]+}/u, I have Invalid regular expression error:

const regex1 = /\$\{[^}]+\}/u

const regex2 = /\${[^}]+}/u;
VM356:1 Uncaught SyntaxError: Invalid regular expression: /\${[^}]+}/: Incomplete quantifier
    at <anonymous>:1:16
(anonymous) @ VM356:1

Same with:

  • /{{([^{}]+?)}}/gu -> /\{\{([^{}]+?)\}\}/gu: Lone quantifier brackets
  • /\$\{$/u -> /\${$/u: Incomplete quantifier
  • /^\/([^\\[]|\\.|\[([^\\\]]|\\.)+\])*\/[gimuys]*$/u -> /^\/([^[\\]|\\.|\[([^\\\]]|\\.)+])*\/[gimsuy]*$/u: Unterminated group
  • /\$\{[^}]+\}/u -> /\${[^}]+}/u: Incomplete quantifier
  • /\\(\$\{|\r\n?|\n|.)|["']|\$\{|(\r\n?|\n)/gu -> /\\(\${|\r\n?|\n|.)|["']|\${|(\r\n?|\n)/gu: Incomplete quantifier

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

EvgenyOrekhovcommented, Jul 26, 2021

One more minimal reproduction:

/\]/u -> /]/u: Lone quantifier brackets

DmitrySoshnikovcommented, Jul 26, 2021

@EvgenyOrekhov thanks for the extra example. I won’t appreciate a PR fixing this issue if you’d like to come up with one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incomplete Quantifier on Regex in vscode
I am trying to create a regex expression for the beginning of an object so I can replace the block complete with a...
Read more >
Incomplete Quantifier On Regex In Vscode
Incomplete pattern matches are implicitly generated for sums of products. with ... Ordinarily, quantifiers are greedy; they cause the regular expression ...
Read more >
Quantifiers in Regular Expressions
Ordinarily, quantifiers are greedy. They cause the regular expression engine to match as many occurrences of particular patterns as possible ...
Read more >
regex incomplete quantifier Code Example
Answers related to “regex incomplete quantifier” · regex diferent of · regex for erlang online · regExp numero français · regex online converter...
Read more >
Quantifiers - JavaScript - MDN Web Docs - Mozilla
If used immediately after any of the quantifiers * , + , ? , or {} , makes the quantifier non-greedy (matching the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found