JounQin
(JounQin)
1
Make sure to read this post before raising a thread here:
Then tell us:
- What language is this for?
JavaScript
unused-named-groups
- Why do you believe it’s a false-positive/false-negative?
The \1
can not use group name quote
, and <quote>
is for meaningful group
SonarQube Cloud?
- How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)
const codeBlockFileNameRegex = /filename=(?<quote>["'])(?<filename>.*?)\1/u
JounQin
(JounQin)
3
Just learn that we can use \k<quote>
instead of \1
:
const codeBlockFileNameRegex = /filename=(?<quote>["'])(?<filename>.*?)\k<quote>/u
system
(system)
Closed
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.