2.0.0 • Published 2 years ago

is-regexy v2.0.0

Weekly downloads
14
License
MIT
Repository
github
Last release
2 years ago

is-regexy npm build codecov management: perfekt👌

A very simple library for checking if a given value (Regex object OR string) is a valid regular expression.

Useful when you want to allow users to pass regex patterns as input.

Example

const isRegexy = require('is-regexy') // CommonJS
// OR
import isRegexy from 'is-regexy' // ES modules

isRegexy('foo') // false

isRegexy(/foo/) // true
isRegexy(new RegExp('foo')) // true
isRegexy('/foo/') // true
isRegexy('/foo/ig') // true
isRegexy('/(epic|feat|fix|chore)/DEV-\\d{4}/i') //true

License

MIT

2.0.0

2 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-alpha

4 years ago