# data-uri-regex

> Regexp for data-uri

Latest version **0.1.4** (published 2016-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install data-uri-regex
pnpm add data-uri-regex
yarn add data-uri-regex
bun add data-uri-regex
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2016-07-16 |
| First published | 2015-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | ragingwind |
| Maintainers | ragingwind |
| Keywords | regex, regexp, data-uri, data-uri-regex |

## Links

- npm: https://www.npmjs.com/package/data-uri-regex
- Repository: https://github.com/ragingwind/data-uri-regex
- Homepage: https://github.com/ragingwind/data-uri-regex#readme
- Issues: https://github.com/ragingwind/data-uri-regex/issues
- npm.io page: https://npm.io/package/data-uri-regex

## Recent versions

- 0.1.4 (latest) — 2016-07-16
- 0.1.3 — 2015-12-16
- 0.1.2 — 2015-12-16
- 0.1.1 — 2015-12-16
- 0.1.0 — 2015-12-16

## README

# data-uri-regex [![Build Status](https://travis-ci.org/ragingwind/data-uri-regex.svg?branch=master)](https://travis-ci.org/ragingwind/data-uri-regex)

> Regexp for data-uri


## Install

```
$ npm install --save data-uri-regex
```


## Usage

```js
const dataUriRegex = require('data-uri-regex');

var png = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='

png.match(dataUriRegex());
//=> true

dataUriRegex().test(png);
//=> true

dataUriRegex().exec(png)[1];
//=> 'data:'

dataUriRegex().exec(png)[2];
//=> 'image/png'

dataUriRegex().exec(png)[3];
//=> 'base64'

dataUriRegex().exec(png)[4];
//=> 'iVB'
```


## API

### dataUriRegex()

It will return the instance of RegExp() for match data-uri strings.

## License

MIT © [ragingwind](http://ragingwind.me)

---
_Source: https://npm.io/package/data-uri-regex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
