Regular Expressions 101

Find Capture groups in RegExp Source

Open Workspace
  • JavaScript
  • Match
0

Regular Expression

/
(?<!\\)\((\?<(?<name>[\w][\w\d_]+)>|(?=[^\?]))
/
gm

Description

Find all capture groups in RegExp source. All forms of None-capture groups are ignored. name of named capture group will be captured by the name "name" which is group[2].

Submitted by Anonymous