@jswork/wildcard-match
v1.0.1
Published
A function for matching strings using * wildcard patterns.
Readme
wildcard-match
A function for matching strings using * wildcard patterns.
installation
npm install @jswork/wildcard-matchusage
import wildcardMatch from '@jswork/wildcard-match';
// 测试案例
console.log(wildcardMatch("filename.txt", "*name")); // false
console.log(wildcardMatch("filename.txt", "name*")); // false
console.log(wildcardMatch("filename.txt", "*name*")); // true
console.log(wildcardMatch("abcfilenameabc", "*xx*name*xx*")); // false
console.log(wildcardMatch("xxabcnamexx", "*xx*name*xx*")); // truelicense
Code released under the MIT license.
