1.0.0 • Published 4 years ago

regex-parse v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

Regex Parse Travis CI Build Status

Parse a regex into it's individual parts.

NPM Badge

Install

npm install regex-parse

Usage

const regexParse = require("regex-parse");

regexParse(/a/g);
//=> { main: "a", options: "g" }

regexParse.from({ main: "a", options: "g" })
//=> /a/g

API

regexParse(regex)

regex

Type: RegExp | string

The regex to parse.

regexParser.from(options)

options

Type: object

main

Type: string

The first part of the regex.

options

Type: string

The second part of the regex.