RGBA color values and opacity matcher

Published on Tue Mar 01 2022

Regex to match R-G-B and Opacity with/without "," and even RGBA text It will match rgba(x,x,x,x.x) rgba (x x X x.x) x,x,x,x.x x x x x.x

Additional matching regexes for
RGBA color values and opacity matcher

RGBA color values and opacity matcher

Regex to match R-G-B and Opacity with/without "," and even RGBA text It will match rgba(x,x,x,x.x) rgba (x x X x.x) x,x,x,x.x x x x x.x

Color RegEx

Color RegEx

html color match: transparent, #fff, #123456, rgb, rgba, hsl, hsla

This may be useful or not to test whether a given string is a valid (more or less) html color value. It matches color values such as: - #123 - short hex color value - #123456 - hex color value - rgb(255,255,0) - rgb color value - rgba(255,255,0,1.0) - rgba color value - hsl(360,100%,100%) - hsl color value - hsla(360,100%,100%,0.5334) - hsla color value Regex allows whitespaces between i.e. rgb and (, also between numbers and commas, but not in value like 55% between number and percentage. To change this behaviour simply remove \s*? from appriopriate places.

ReGEX EXPression

ReGEX EXPression generating Values but repeating want values should not repeat.

Match directory path

match with or without prevailing/trailing slashes

Hex Input List

Match one or two digit hex values separated by a comma.

Anagram match of "poultryoutwitsants"

this is an anagram matcher to run upon words

Match Tags in ExpressionEngine

The second matcher will get EE tags from $tagdata.

CSS Colors: RGB(A), HSL(A), HEX(3,4,6,8), var(--tw-color), etc...

Versatile, multiline matching of CSS colors of many common formats, including: - [x] HEX-3: `#123` (equivalent to `#112233`) - [x] HEX-4: `#FA0F` ( ... `#FFAA00FF`) - [x] HEX-6: `#FF3300` ( ...`#F30`) - [x] HEX-8: `#FFAA00FF` ( ...`#FA0F`) - [x] RGB: `rgb(0, 0, 0)` - [x] RGBA: `rgba(255, 255, 255, 1.0)` - [x] HSL: `hsl(100, 50%, 50%)` - [x] HSLA: `hsla(100, 20%, 20%, 1.0)` - [x] Vars: `var(--tw-color-name, #000000)` - [x] Misc: `color: inherit;` `color: currentColor;` `color: initial;`, etc. * With or without trailing semicolon or comma * Forgiving of whitespace issues * Allows property/declaration names (e.g. `color: #fff`), most other solutions do not.

french phone number (intl format)

little matcher for french phone number in international format (example: +33231348228)