A strange question of regular matching?

Code first:

if(/(\module\/(?:.+[^\.html]))/.test("./src/module/comment/details.html")){
    console.log(RegExp.$1) //module/comment/details
}

if(/(\module\/(?:.+[^\.js]))/.test("./src/module/comment/details.js")){
    console.log(RegExp.$1) //module/comment/detail
}

shouldn"t all output / module/comment/details?


[^] reverse match
[^ abc] match not abc a character
/ [^ js] + / .test ('as') matches a will not match s
[^\ .html] match not . Html A character such as a , b , e all passes through t and does not match the five connected words
which are not .html , so your first. / src/module/comment/commen t .html matches t so the match ends with
other similar

.
Menu