hex-color-regex
The best regular expression (regex) for matching hex color values from string.
Install
Usage
For more use-cases see the tests
[opts]
{Object} passstrict: true
for strict modereturn
{RegExp}
Example
Matching groups
match[0]
hex value with hash -#f3f3f3
match[1]
hex value without the hash -f3f3f3
Example
Related
is-hexcolor: Check that given value is valid hex color, using
hex-color-regex
- the best regex for… moreis-ansi: Check that given string contain ANSI color codes, without CLI
is-missing: Check that given
name
oruser/repo
exists in npm registry or in github as user… moreis-typeof-error: Check that given value is any type of error and instanceof Error
is-async-function: Check that given function is async (callback) function or not. Trying to guess that based… more
kind-error: Correct inheriting from
Error
. Supports constructing from an object of properties - focused on assertion.kind-of-extra: Extends
kind-of
type check utility with support for promises, generators, streams and errors. Like `kindof(Promise.resolve(1))… more
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. But before doing anything, please read the CONTRIBUTING.md guidelines.
Last updated