compare-patterns
v1.0.1
Published
module that compare two patterns
Downloads
14
Maintainers
Readme
module that compare two patterns
🏠 Homepage
Install
npm install compare-patterns
Run tests
npm install -D
npm run test
Usage
const comparePatterns = require('compare-patterns');
comparePatterns('a.**.b', 'a.1.2.3.4.5.6.b'); // true
comparePatterns('a.*.b', 'a.1.b'); // true
comparePatterns('a.?.b', 'a.x.b'); // true
Description
- pattern split by '.'
- ** means everything (it equals /.*/ in regex)
- * means everything except '.' (dot) (it equals /[^.]*/ in regex)
- ? means any char (it equals /./ in regex)
Author
👤 0x0a0d
- Github: @0x0a0d
🤝 Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.
Show your support
Give a ⭐️ if this project helped you!