📅  最后修改于: 2022-03-11 15:03:27.748000             🧑  作者: Mango
// Rudimentary code for matching globs with ? and *
// Escape the dots, change * to .* and ? to .
// and make it match entire string
new RegExp
(
'^' +
rx.replaceAll('\.', '\\.')
.replaceAll('*', '.*')
.replaceAll('?', '.') +
'$'
)