Skip to content

A function for matching strings using * wildcard patterns.

License

afeiship/wildcard-match

Repository files navigation

wildcard-match

A function for matching strings using * wildcard patterns.

version license size download

installation

npm install @jswork/wildcard-match

usage

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*")); // true

license

Code released under the MIT license.

About

A function for matching strings using * wildcard patterns.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published