Ivan
0
Q:

JS glob to regex

// 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('?', '.') +
  '$'
)
0

New to Communities?

Join the community