issue-regex
Regular expression for matching issue references
Last updated 3 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install issue-regex 
SYNC missed versions from official npm registry.

issue-regex

Regular expression for matching issue references

Install

npm install issue-regex

Usage

import issueRegex from 'issue-regex';

'Fixes #143 and avajs/ava#1023'.match(issueRegex());
//=> ['#143', 'avajs/ava#1023']

Organization name, repository name, and issue number are also available individually in capturing groups 1-3, or named groups organization, repository, and issueNumber:

issueRegex().exec('Fixes avajs/ava#1023');
/*
[
	'avajs/ava#1023',
	'avajs',
	'ava',
	'1023',
	index: 6,
	input: 'Fixes avajs/ava#1023',
	groups: {
		organization: 'avajs',
		repository: 'ava',
		issueNumber: '1023'
	}
]
*/

API

issueRegex()

Returns a RegExp for matching issue references.

Important

If you run the regex against untrusted user input in a server context, you should give it a timeout.

I do not consider ReDoS a valid vulnerability for this package.

Related

Current Tags

  • 4.1.0                                ...           latest (3 years ago)

6 Versions

  • 4.1.0                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 3.1.0                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.0.0                                ...           7 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 3
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |