diff --git a/.travis.yml b/.travis.yml index f98fed0..f5eabc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: node_js node_js: + - '14' - '12' - '10' - '8' diff --git a/index.js b/index.js index 78eaacf..f8884c8 100644 --- a/index.js +++ b/index.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => /(?<=^v?|\sv?)(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-(?:0|[1-9]\d*|[\da-z-]*[a-z-][\da-z-]*)(?:\.(?:0|[1-9]\d*|[\da-z-]*[a-z-][\da-z-]*))*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?(?=$|\s)/ig; +module.exports = () => /(?<=^v?|\sv?)(?:(?:0|[1-9]\d*)\.){2}(?:0|[1-9]\d*)(?:-(?:0|[1-9]\d*|[\da-z-]*[a-z-][\da-z-]*)(?:\.(?:0|[1-9]\d*|[\da-z-]*[a-z-][\da-z-]*))*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?(?=$|\s)/gi; diff --git a/license b/license index e7af2f7..fa7ceba 100644 --- a/license +++ b/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/package.json b/package.json index 09e04af..2bbe548 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,11 @@ "description": "Regular expression for matching semver versions", "license": "MIT", "repository": "sindresorhus/semver-regex", + "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" + "url": "https://sindresorhus.com" }, "engines": { "node": ">=8" diff --git a/readme.md b/readme.md index a23daac..62381fc 100644 --- a/readme.md +++ b/readme.md @@ -1,15 +1,13 @@ -# semver-regex [![Build Status](https://travis-ci.org/sindresorhus/semver-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/semver-regex) +# semver-regex [![Build Status](https://travis-ci.com/sindresorhus/semver-regex.svg?branch=master)](https://travis-ci.com/github/sindresorhus/semver-regex) > Regular expression for matching [semver](https://github.com/npm/node-semver) versions - ## Install ``` $ npm install semver-regex ``` - ## Usage ```js @@ -28,7 +26,6 @@ semverRegex().exec('unicorn 1.0.0 rainbow')[0]; //=> ['1.0.0', '2.1.3'] ``` - ## Related - [find-versions](https://github.com/sindresorhus/find-versions) - Find semver versions in a string @@ -36,8 +33,3 @@ semverRegex().exec('unicorn 1.0.0 rainbow')[0]; - [to-semver](https://github.com/sindresorhus/to-semver) - Get an array of valid, sorted, and cleaned semver versions from an array of strings - [semver-diff](https://github.com/sindresorhus/semver-diff) - Get the diff type of two semver versions: `0.0.1` `0.0.2` → `patch` - [semver-truncate](https://github.com/sindresorhus/semver-truncate) - Truncate a semver version: `1.2.3` → `1.2.0` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com)