Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog
Design
#rgb
#color
#css
#design

RGB Color

Matches an RGB color value in the format rgb(R, G, B) where each channel is 0–255.

✓ CSS value parsing✓ Design tool input✓ Color conversion
/
/
Safe
Test String
3 matches
rr— 'r' — literal character
gg— 'g' — literal character
bb— 'b' — literal character
\(\(— \( — escaped character '('
\s*space— \s — whitespace (space, tab, newline…) — repeated zero or more times (greedy) · * — zero or more times (greedy)
(…)Group #1— Capturing group — captures matched text for reuse or extraction
22— '2' — literal character
55— '5' — literal character
[…]Character class […]— Matches any single character listed in this set
||— | — alternation: matches expression on left OR right
22— '2' — literal character
[…]Character class […]— Matches any single character listed in this set
\ddigit— \d — digit (0–9)
||— | — alternation: matches expression on left OR right
1?1— '1' — literal character — repeated zero or one time (optional) · ? — zero or one time (optional)
\ddigit— \d — digit (0–9)
\d?digit— \d — digit (0–9) — repeated zero or one time (optional) · ? — zero or one time (optional)
\s*space— \s — whitespace (space, tab, newline…) — repeated zero or more times (greedy) · * — zero or more times (greedy)
,,— ',' — literal character
\s*space— \s — whitespace (space, tab, newline…) — repeated zero or more times (greedy) · * — zero or more times (greedy)
(…)Group #2— Capturing group — captures matched text for reuse or extraction
22— '2' — literal character
55— '5' — literal character
[…]Character class […]— Matches any single character listed in this set
||— | — alternation: matches expression on left OR right
22— '2' — literal character
[…]Character class […]— Matches any single character listed in this set
\ddigit— \d — digit (0–9)
||— | — alternation: matches expression on left OR right
1?1— '1' — literal character — repeated zero or one time (optional) · ? — zero or one time (optional)
\ddigit— \d — digit (0–9)
\d?digit— \d — digit (0–9) — repeated zero or one time (optional) · ? — zero or one time (optional)
\s*space— \s — whitespace (space, tab, newline…) — repeated zero or more times (greedy) · * — zero or more times (greedy)
,,— ',' — literal character
\s*space— \s — whitespace (space, tab, newline…) — repeated zero or more times (greedy) · * — zero or more times (greedy)
(…)Group #3— Capturing group — captures matched text for reuse or extraction
22— '2' — literal character
55— '5' — literal character
[…]Character class […]— Matches any single character listed in this set
||— | — alternation: matches expression on left OR right
22— '2' — literal character
[…]Character class […]— Matches any single character listed in this set
\ddigit— \d — digit (0–9)
||— | — alternation: matches expression on left OR right
1?1— '1' — literal character — repeated zero or one time (optional) · ? — zero or one time (optional)
\ddigit— \d — digit (0–9)
\d?digit— \d — digit (0–9) — repeated zero or one time (optional) · ? — zero or one time (optional)
\s*space— \s — whitespace (space, tab, newline…) — repeated zero or more times (greedy) · * — zero or more times (greedy)
\)\)— \) — escaped character ')'
Pattern: 105 charsInput: 49 chars
100% client-side · private

✓ Valid Examples

  • rgb(255, 0, 0)
  • rgb(0, 128, 255)
  • rgb(74, 222, 128)

✗ Invalid Examples

  • rgb(256, 0, 0)
  • rgb(0, 0)
  • rgba(0, 0, 0, 1)

Usage & Integration

Validate RGB Color natively in your backend or frontend without copying regex strings.

Node / Edge

import { validate } from '@regexto/validators';

validate('rgb-color', '...');

Python

from regexto_validators import validate

validate("rgb-color", "...")

Go

import "github.com/regex-to/validators-go"

valid, err := validators.Validate("rgb-color", "...")

PHP

use RegexTo\Validators\Validator;

Validator::validate('rgb-color', '...');

Rust

use regexto_validators::validate;

let is_valid = validate("rgb-color", "...").unwrap();