Please enable JavaScript to use this web application.
Regular
Expressions
101
Social
Donate
Info
Regex Editor
Community Patterns
Account
Regex Quiz
Settings
Order By
Most Recent
Most upvotes
Most downvotes
Highest Score
Lowest Score
Relevance
Filter by Flavor
PCRE2 (PHP >=7.3)
PCRE (PHP <7.3)
ECMAScript (JavaScript)
Python
Golang
Java 8
.NET 7.0 (C#)
Rust
Sponsors
There are currently no sponsors.
Become a sponsor today!
Community Patterns
Search among 80 community submitted regex patterns...
11
html color match: transparent, #fff, #123456, rgb, rgba, hsl, hsla
ECMAScript (JavaScript)
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...
Submitted by
grouch
-
10 years ago
13
CSS Color Matcher
ECMAScript (JavaScript)
Pattern matching and extracting color code formats using RegEx. https://github.com/Kyza/color-regex/
Submitted by
Kyza
-
a year ago
1
HTML color search
PCRE (PHP <7.3)
Searches for hex colors in HTML code.
Submitted by
Barlean
-
10 years ago
1
spaces in parenthesis
ECMAScript (JavaScript)
Eliminate spaces in the inner part of parenthesis.
Submitted by
Luis Colorado
-
10 years ago
4
Validate hex color
PCRE (PHP <7.3)
Validates hexadecimal color codes based on the following rule set: Optionally starting with a hash. 3 or 6 characters in length. Using the [0-9a-f] character set.
Submitted by
Nathaniel Blackburn
-
9 years ago
3
HSL(A) Color Matching
PCRE (PHP <7.3)
This allows for both hsl and hsla color patterns to be matched. hsla(50.5deg, .531%, .9%, 1.0) The hue can be matched without the word deg. Hue is from 0-360 Percentage allows for decimals. Percentage is from 0-100%...
Submitted by
anonymous
-
5 years ago
2
CSS Colors: RGB(A), HSL(A), HEX(3,4,6,8), var(--tw-color), etc...
ECMAScript (JavaScript)
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)...
Submitted by
Nicholas Berlette (@nberlette)
-
3 years ago
2
RGB [0;255]
PCRE (PHP <7.3)
Color RGB in shape: 255, 255, 255 ',' or ';' are accepted
Submitted by
theBlueBisu
-
9 years ago
2
Detect RGB/RGBA colors in CSS
PCRE2 (PHP >=7.3)
JS function to convert RGB(A) to HEX color for single values: /** @param {string} color the RGB(A) color @return {string} the HEX color */ function rgba2hex(color)...
Submitted by
WinterSilence
-
2 years ago
0
Facebook Page/Profile. No profile.php. No /groups/
PCRE (PHP <7.3)
Example: http://www.facebook.com/profile.php?id=123456789 http://www.facebook.com/someusername https://www.facebook.com/0x20.be http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2F2leep%2F109473355777935&width=300&connections=4&stream=false&heade...
Submitted by
aramosf
-
9 years ago
1
Match Hexadecimal Color with Optional Alpha
PCRE2 (PHP >=7.3)
theunjob.com
Submitted by
anonymous
-
3 months ago
1
Valid HTML Tag Pattern
PCRE2 (PHP >=7.3)
Valid HTML Tag Pattern Which HTML tags are considered invalid: Tags ending with a different tag than what it started. Example: Hello Tags with open attributes (or closed with a different type of quote). Examples: Hello or Hello Which HTML tags are considered valid: Tags ending with the same tag...
Submitted by
Ninja
-
7 months ago
(Last modified 7 months ago)
1
JavaScript number literals
ECMAScript (JavaScript)
Should match any valid JavaScript number literal incl. bigint. See EDIT 4 in this StackOverflow answer by me for matching JS numbers. open in regex101 editor - example matches and unit tests\ Regulex%7C%5BoO%5D%3F%5B0-7%5D(%3F%3A_%3F%5B0-7%5D%2B)%7C%5BxX%5D%5B0-9a-fA-F%5D(%3F%3A_%3F%5B0-9a-fA-F%5D...
Submitted by
MAZ01001
-
9 months ago
(Last modified 6 months ago)
1
match hex colors
PCRE2 (PHP >=7.3)
Match hex colors with PCRE2
Submitted by
anonymous
-
a year ago
1
nmcli WiFi list
PCRE2 (PHP >=7.3)
Extract different fields from the list output of nmcli: nmcli --terse --colors no --fields IN-USE,BSSID,SSID,MODE,CHAN,RATE,SIGNAL,BARS,SECURITY,FREQ,DEVICE device wifi list
Submitted by
Simon Bagley
-
a year ago
(Last modified a year ago)
1
Match Hex Color Codes
PCRE2 (PHP >=7.3)
DartWhite.com
Submitted by
anonymous
-
3 months ago
1
Hexadecimal Color Code Validation
PCRE2 (PHP >=7.3)
murdochleaks.org
Submitted by
anonymous
-
3 months ago
1
RGB 256 Color Format: Matches 24bit RGB Colors.
ECMAScript (JavaScript)
There are several ways to format 24bit RGB Colors, however, two of the formats are far more common in the wild than others. The 2 most common 24bit RGB formats are | FORMAT | Alt Name | Num Sys | | ------------------------ | -------------- | ------------ | | RGB Hex Format | HexColo...
Submitted by
anonymous
-
3 years ago
(Last modified 3 years ago)
1
RGB Colors in Hex Format: 3 or 6 Hexadecimal Digits
ECMAScript (JavaScript)
Matches against RGB (not to be confused with RGBa). Will match against any and all RGB Hexadecimal Formatted colors. Some example of the values this regular expression was created to match are: "#FFFFFF", "#FFF", "#ABCDEF", "#123456", "#18F", "#812" MUST USE THE 'i' FLAG (insensitive) Without the...
Submitted by
jD3V
-
3 years ago
(Last modified 3 years ago)
1
Match Valid HTML5 Color Names
PCRE2 (PHP >=7.3)
RascalJournal.com
Submitted by
anonymous
-
3 months ago
1
2
3
4
Community Library Entry
0
Regular Expression
Python
r"
(?<!
\n
)
#
[
\d
a
-
f
]
{3}
(?!
\w
)
(?!
\n
)
|
(?<!
\n
)
#
[
\d
a
-
f
]
{6}
(?!
\w
)
(?!
\n
)
"
g
Open regex in editor
Description
no description available
Submitted by
anonymous
-
7 years ago