Please enable JavaScript to use this web application.
Regular
Expressions
101
Social
Social
Join the Discord community!
Follow me on twitter!
Send me an email
Donate
Donate
Donate through Paypal
Become a Github Sponsor
Info
Info
Find out what's new!
RegEx101 Wiki
Report bugs or make suggestions
What's new?
Loading content...
Close
Regex Editor
Regex Editor
Community Patterns
Community Patterns
Account
Account
Regex Quiz
Regex Quiz
Settings
Settings
Live Help
Live Help
Get help on Discord
Get help on IRC
Order By
Most Recent
Highest Score
Lowest Score
Most upvotes
Most downvotes
Filter by Flavor
PCRE2 (PHP >=7.3)
PCRE (PHP <7.3)
ECMAScript (JavaScript)
Python
Golang
Java 8
.NET (C#)
Rust
Sponsors
Community Patterns
Search among 14,820 community submitted regex patterns...
17
34 upvotes, 17 downvotes (score 53%) (You must be signed in to vote)
Between tags content
PCRE (PHP <7.3)
no description available
Submitted by
AgustÃn Bouillet
-
8 years ago
2015-10-24 10:52
6
7 upvotes, 1 downvotes (score 52.9%) (You must be signed in to vote)
SO: fail2ban regular to find 403 request in nginx
Python
http://stackoverflow.com/q/25778420/2072035
Submitted by
anonymous
-
9 years ago
2014-09-15 11:32
(Last modified 2 months ago)
2023-07-27 20:59
6
7 upvotes, 1 downvotes (score 52.9%) (You must be signed in to vote)
[A-Za-z\x{0600}-\x{06FF}\x{1000}-\x{1021}_-][-\w]*
PCRE (PHP <7.3)
A-Za-z\x{0600}-\x{06FF}\x{1000}-\x{1021}_-*
Submitted by
[A-Za-z\x{0600}-\x{06FF}\x{1000}-\x{1021}_-][-\w]*
-
9 years ago
2014-11-03 16:04
6
7 upvotes, 1 downvotes (score 52.9%) (You must be signed in to vote)
TimezoneOffset
ECMAScript (JavaScript)
used to parse timezone in the format -08:00 or +05:30
Submitted by
Neha
-
9 years ago
2014-12-09 07:00
8
11 upvotes, 3 downvotes (score 52.4%) (You must be signed in to vote)
Extract url GET parameters
PCRE (PHP <7.3)
Returns key/value pair of a url. Also works with google fonts which has additional information
Submitted by
anonymous
-
9 years ago
2014-09-16 08:37
8
11 upvotes, 3 downvotes (score 52.4%) (You must be signed in to vote)
If-Then-Else Conditionals
PCRE (PHP <7.3)
no description available
Submitted by
anonymous
-
8 years ago
2015-08-28 15:52
8
11 upvotes, 3 downvotes (score 52.4%) (You must be signed in to vote)
money: either 0 or 2 dp
ECMAScript (JavaScript)
no description available
Submitted by
anonymous
-
8 years ago
2015-11-18 19:34
28
77 upvotes, 49 downvotes (score 52.4%) (You must be signed in to vote)
CSV line parsing
PCRE (PHP <7.3)
Captures all fields from a CSV file's line. Can be customized with user-defined field separator and protecting character.
Submitted by
Various
-
9 years ago
2014-10-15 13:22
51
191 upvotes, 140 downvotes (score 52.3%) (You must be signed in to vote)
Disorted Email Addresses
PCRE (PHP <7.3)
Matches distorted email addresses and converts them back to real ones.
Submitted by
dislick
-
11 years ago
2013-01-16 14:11
7
9 upvotes, 2 downvotes (score 52.3%) (You must be signed in to vote)
Sentence grabber /w extra check
PCRE (PHP <7.3)
Grabs sentences including terms like: e.g. z.b. Figs.These get caught in 1st capturing group. Problem: how to only accept matching sentences which contain pattern \b\d+[a-z]{0,2}\b?
Submitted by
light0
-
9 years ago
2014-05-29 17:30
7
9 upvotes, 2 downvotes (score 52.3%) (You must be signed in to vote)
Max - URL Extract
PCRE (PHP <7.3)
no description available
Submitted by
Ayush
-
7 years ago
2016-05-09 10:38
18
310 upvotes, 292 downvotes (score 52.3%) (You must be signed in to vote)
Date: DD-MM-YYYY hh:mm:ss
Recommended
This entry has been specifically selected by our team to be a great submission
PCRE (PHP <7.3)
Validate and capture dateTime parts, includes validation for leap years, range 1000-2999. Fixed bug
Submitted by
Ka.
-
10 years ago
2013-05-17 13:07
107
601 upvotes, 494 downvotes (score 51.9%) (You must be signed in to vote)
trim
ECMAScript (JavaScript)
trim string
Submitted by
fp
-
10 years ago
2013-09-10 08:21
24
67 upvotes, 43 downvotes (score 51.6%) (You must be signed in to vote)
Quote Macthing with escape
ECMAScript (JavaScript)
Matches text within quotes (", ') and escapes the charecters.
Submitted by
Vihan Bhargava
-
8 years ago
2015-05-10 20:48
11
19 upvotes, 8 downvotes (score 51.5%) (You must be signed in to vote)
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
-
9 years ago
2014-12-17 13:00
22
59 upvotes, 37 downvotes (score 51.5%) (You must be signed in to vote)
UK Postcode Checker
PCRE (PHP <7.3)
Checks for valid UK/British postcodes. There was another on here that had for some reason been upvoted, but it was actually incorrect as it worked on none of my valid own postcodes! Namely that it assumed two letters and a number (BS3) when you can have variations (M20). Allows for an optional spac...
Submitted by
MaffooBristol
-
9 years ago
2014-10-21 08:23
34
123 upvotes, 89 downvotes (score 51.3%) (You must be signed in to vote)
Google like regex
ECMAScript (JavaScript)
Attempts to mimic Google search box behavior, returning an array with the separated search strings (that keep the +/- indicator for following operations)
Submitted by
mettjus
-
9 years ago
2014-05-12 13:35
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
For Auto RTFs
PCRE (PHP <7.3)
no description available
Submitted by
Dan Bloomquist
-
11 years ago
2013-03-22 03:32
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
outer Parentheses
PCRE (PHP <7.3)
Finds the outermost pair of parentheses. Compatible with any amount of nesting
Submitted by
Jonas Gerneth
-
9 years ago
2014-04-25 11:43
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Command handling
PCRE (PHP <7.3)
Handles commands like in CMD
Submitted by
anonymous
-
9 years ago
2014-09-07 07:03
1
2
3
4
5
6
7
...
741
hsl colors
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Regular Expression
ECMAScript (JavaScript)
/
^
hsla
?
\(
\s
*
(?<h>
[
-+
]
?
\d
{1,3}
(?:
\.
\d
+
)?
)
(
deg
|
grad
|
rad
|
turn
)?
\s
*
(?:
,
\s
*
|
\s
+
)
\s
*
(?<s>
[
-+
]
?
\d
{1,3}
(?:
\.
\d
+
)?
)
%
\s
*
(?:
,
\s
*
|
\s
+
)
\s
*
(?<l>
[
-+
]
?
\d
{1,3}
(?:
\.
\d
+
)?
)
%
\s
*
(?:
,
\s
*
|
\s
+
)?
(?:
\s
*
\/
?
\s
*
(?<alpha>
[
-+
]
?
[
\d
.
]
+
%
?
)
\s
*
)?
\)
$
/
gmi
Open regex in editor
Description
Loading markdown...
Submitted by
anonymous
-
5 months ago
2023-04-25 09:35