Here is my code
let text = 'test.users.mail.com'
let pattern = /(\w+\.)+\w+/i;
let matches = pattern.exec(text)
console.log(matches.index)
console.log("0", matches[0])
console.log("1", matches[1])
console.log("2", matches[2])
There are only two matches found, they are: "test.users.mail.com" and "mail.".
So why sequence like users. doesn't match? I don't understand.
0 Replies