compare-patterns
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Welcome to compare-patterns 👋

Version License: ISC

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

🤝 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!

Package Sidebar

Install

npm i compare-patterns

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

3.19 kB

Total Files

4

Last publish

Collaborators

  • 0x0a0d