Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeroenvdb/calmcard
not-so-wild wildcard string matching
https://github.com/jeroenvdb/calmcard
Last synced: about 2 months ago
JSON representation
not-so-wild wildcard string matching
- Host: GitHub
- URL: https://github.com/jeroenvdb/calmcard
- Owner: JeroenVdb
- License: mit
- Created: 2015-09-09T20:02:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-15T12:54:17.000Z (over 9 years ago)
- Last Synced: 2023-07-31T21:09:30.220Z (over 1 year ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
calmcard
========**not-so-wild wildcard string matching**
Calmcard provides a simple string pattern matching with `*` as the only special character which is a placeholder for
any sequence of characters, unless it is escaped.Calmcard was made to have a `glob` like tool for arbitrary strings where slashes have no special meaning. It also does
explicitly not use regular expressions because of speed, proper escaping and because writing regular expression strings
in JavaScript gets messy and unreadable very quick.## Examples
* `foo*bar` will match "foo123bar"
* `foo\*bar` will match "foo\*bar" but not "foo123bar"## Installation
Currently, calmcard is built for node.js and available via NPM.
npm install calmcard
## Usage
```js
var calmcard = require("calmcard");calmcard("foo*bar", "foo123bar"); // -> true
calmcard("foo*bar", "foobar"); // -> false
```