Community Patterns

Community Library Entry

1

Regular Expression
Created·2023-09-10 16:30
Flavor·PCRE2 (PHP)

/
#[0-9a-f]{3}(?:[0-9a-f]{3})?(?=\W|$)
/
gm
Open regex in editor

Description

This regex will find any hexadecimal colour code, anywhere in your string

Support for: mini 3 letter codes normal 6 letter codes back to back codes

Submitted by anonymous