см. NodeJ, здесь ниже:
$ node
Welcome to Node.js v12.3.1.
> regexp = /cerca (?<word>.+) su (?<dictionary>wikipedia|treccani|garzanti|google)/i
> string = 'cerca chatbots su wikipedia'
> matchData = string.match(regexp)
[
'cerca chatbots su wikipedia',
'chatbots',
'wikipedia',
index: 0,
input: 'cerca chatbots su wikipedia',
groups: [Object: null prototype] {
word: 'chatbots',
dictionary: 'wikipedia'
}
]
> matchData.groups.word
'chatbots'
> matchData.groups.dictionary
'wikipedia'
Совпадение с регулярным выражением мне кажется вполне подходящим, и именованные группы перехватываются идеально, но что это означает [Object: null prototype] оператор в узле console.log REPL?
спасибо