Last active
October 21, 2017 20:07
-
-
Save nblackburn/7bb4e7fa8f1ed5106ccc81c93308af0f to your computer and use it in GitHub Desktop.
Check if a string matches a wildcard pattern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = (test, pattern) => { | |
| return new RegExp(test.replace(/\*/g, '([^*]+)'), 'g').test(pattern); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment