is-regexy
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    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

    Install

    npm i is-regexy

    DownloadsWeekly Downloads

    24

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    3.6 kB

    Total Files

    5

    Last publish

    Collaborators

    • lekterable