data-uri-regex
Regexp for data-uri
Install
$ npm install --save data-uri-regex
Usage
const dataUriRegex = require('data-uri-regex');
var png = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
png.match(dataUriRegex());
dataUriRegex().test(png);
dataUriRegex().exec(png)[1];
dataUriRegex().exec(png)[2];
dataUriRegex().exec(png)[3];
dataUriRegex().exec(png)[4];
API
dataUriRegex()
It will return the instance of RegExp() for match data-uri strings.
License
MIT © ragingwind