1.0.1 ā¢ Published 3 years ago
compare-patterns v1.0.1
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!