Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 754 Bytes

.verb.md

File metadata and controls

43 lines (28 loc) · 754 Bytes

{%= name %} {%= badge("fury") %}

{%= description %}

If you've ever tried to create a JavaScript regular expression for validating a range of years, you'll know it's not easy. This solves that problem.

Install

{%= include("install-npm", {save: true}) %}

Usage

var yearRange = require('{%= name %}');

yearRegex(1992, 2015);
//=> /^(199[2-9]|200[0-9]|201[0-5])$/

yearRange(0, 1999)
//=> /^([0-9]|[1-9][0-9]|[1-9][0-9]{2}|1[0-9]{3})$/

yearRange(2016)
//=> /^(2016)$/

Related projects

{%= related(verb.related.list) %}

Running tests

{%= include("tests") %}

Contributing

{%= include("contributing") %}

Author

{%= include("author") %}

License

{%= copyright() %} {%= license() %}


{%= include("footer") %}