https://github.com/euank/regex-chain
Chain regexes together in nodejs
https://github.com/euank/regex-chain
Last synced: over 1 year ago
JSON representation
Chain regexes together in nodejs
- Host: GitHub
- URL: https://github.com/euank/regex-chain
- Owner: euank
- License: mit
- Created: 2013-11-23T06:47:40.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-23T07:00:45.000Z (over 12 years ago)
- Last Synced: 2025-02-28T03:43:54.339Z (over 1 year ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
regex-chain
===========
Chain regexes together in nodejs
Installation
------------
`npm install regex-chain`
Usage
-----
var RegexChain = require('regex-chain');
var containsNumbers = new RegexChain(/[0-9]/);
var containsLetters = new RegexChain(/[a-zA-Z]/);
console.log("asdf09 contains letters and numbers: " + containsLetters.and(containsNumbers).test("asdf09"));
console.log("asdf contains letters and numbers: " + containsLetters.and(containsNumbers).test("asdf"));
Todo
----
- Generate some documentation. For now, just skim the unit tests or code
- Allow more than just `.test` method. `exec` would be the best one