README
regexp-id
Returns an identifier based on a RegExp match against an object property's value.
npm install regexp-id --save
You can also use Duo, Bower or download the files manually.
npm stats
API Example
var regexpId = require('regexp-id')
var company = {
name: 'Acme Corporation',
contact: '"Example Anvil" <example.anvil@example.com>'
}
var id = regexpId(/^"([^"]+)"/, 'contact')
id(company)
//=> '"Example Anvil"'
API
regexpId(regexp, key)
arguments
regexp (RegExp)
Regular expression.path (String)
Dot or bracket-notation string path.
returns
(Function)
Unary function accepting an object to evaluate.
Contributing
SEE: contributing.md