I want to use javascript regexp to parse my bind9 zone file with comments, I tested it ok on https://regex101.com/r/qnoZbK/1, however I could not get group name in Chrome dev tools.
The test code is
const contents = `; the is some comment
name1 IN CNAME value1
name2 IN A value2
;name3 IN A value3
; the is another comment
name4 IN A value4`
const regexp = /(?:^;\s*(?<comment>.+?)\s*$\n)?^\s*(?!;)(?<name>.*?)\s+(?<className>.*?)\s+(?<type>.*?)\s+(?<value>.*?)$/gm
const matches = contents.matchAll(regexp)
for (const match of matches) {
console.info(match)
}
The following was the snapshot of my Chrome