Regular expression to match percentage values
Install
$ npm install --save percentage-regex
Usage
var percentageRegex = ; 'I am 99% sure that was a unicorn';//=> ['99%'] 'I had 83% for maths and 68% for French';//=> ['83%', '68%'] ;//=> true
API
percentageRegex(options)
Returns a regex for matching percentage values.
options.exact
Type: boolean
Default: false
(Matches any percentage in a string)
Only match an exact string. Useful with RegExp#test
to check if some string is a percentage.
License
MIT © Arthur Verschaeve