*nix Programming Mammals

    create-word-boundary-regex

    1.0.0 • Public • Published

    create-word-boundary-regex

    Last version Build Status Coverage Status Dependency status Dev Dependencies Status NPM Status Donate

    Helper for create a word boundary regex based in a collection

    Install

    $ npm install create-word-boundary-regex --save

    Usage

    const createWordBoundaryRegex = require('create-word-boundary-regex')
     
    const regex = createWordBoundaryRegex([
      'hello',
      'world'
    ])
     
    console.log(regex)
    // => /\bhello\b|\bworld\b/i

    API

    createWordBoundaryRegex(collection, [flags])

    collection

    Required
    Type: Array

    Collection of String for create the regex.

    flags

    Type: String Default: i

    Regex flags for create the regex.

    License

    MIT © Kiko Beats.

    Install

    npm i create-word-boundary-regex

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • kikobeats