• Returns the array of strings that match the given pattern in the text

    Parameters

    • Optionaltext: null | string

      the text to inspect

    • search: string | RegExp = ...

      the string or regex to match

    Returns string[] | undefined

    the array of strings that match the given pattern in the text

    extractWords('foo, & bar');    // ['foo', 'bar']