Initial commit
[yaffs-website] / node_modules / semver-regex / readme.md
1 # semver-regex [![Build Status](https://travis-ci.org/sindresorhus/semver-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/semver-regex)
2
3 > Regular expression for matching [semver](https://github.com/isaacs/node-semver) versions
4
5
6 ## Install
7
8 ```sh
9 $ npm install --save semver-regex
10 ```
11
12
13 ## Usage
14
15 ```js
16 var semverRegex = require('semver-regex');
17
18 semverRegex().test('v1.0.0');
19 //=> true
20
21 semverRegex().test('1.2.3-alpha.10.beta.0+build.unicorn.rainbow');
22 //=> true
23
24 semverRegex().exec('unicorn 1.0.0 rainbow')[0];
25 //=> 1.0.0
26
27 'unicorn 1.0.0 and rainbow 2.1.3'.match(semverRegex());
28 //=> ['1.0.0', '2.1.3']
29 ```
30
31 *It's a function so you can create multiple instances. Regexes with the global flag will have the `.lastIndex` property changed for each call to methods on the instance. Therefore reusing the instance with multiple calls will not work as expected for `.test()`.*
32
33
34 ## License
35
36 MIT © [Sindre Sorhus](http://sindresorhus.com)