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
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 3,260 community submitted regex patterns...
18
Get path from any text
Recommended
PCRE2 (PHP >=7.3)
Get path (windows style) from any type of text (error message, e-mail corps ...), quoted or not. THIS IS THE SINGLE LINE VERSION !_ If you want understand how it work or edit it, go https://regex101.com/r/7o2fyy Relative path are not supported...
Submitted by
nitrateag
-
2 years ago
(Last modified a year ago)
4
CloudFlare
PCRE2 (PHP >=7.3)
Cloud Flare
Submitted by
anonymous
-
3 years ago
4
Email
PCRE2 (PHP >=7.3)
email format control
Submitted by
ahmetbarut
-
3 years ago
4
Match any url in text or html (http, https)
PCRE2 (PHP >=7.3)
Match any url in text or html (http, https)
Submitted by
Jérémy Munsch
-
3 years ago
4
C# Regex Extract/Match Nested HTML Elements/Tags
.NET 7.0 (C#)
With this C# regex, you can easily match/Parse Nested HTML tags. Example input: ...
Submitted by
w4po
-
3 years ago
(Last modified a year ago)
3
Hostname validation
Golang
Validates subdomain, root domain, and wild card domains
Submitted by
AnonymousDapper
-
8 years ago
2
Regex tutorial
Java 8
Case insensitive match the whole word betwween \bword\b
Submitted by
anonymous
-
4 years ago
(Last modified a year ago)
3
National Insurance Number regular expression
PCRE2 (PHP >=7.3)
This regular expression is build from the description of NINO number of GOV.UK,
Submitted by
Iftakhar Husan
-
4 years ago
3
Livestock - Visual tag and Back tag
PCRE2 (PHP >=7.3)
Visual tag and Back tag cannot more than 15 characters or only can contain uppercase, lowercase, space and dash.
Submitted by
Adrian Yim
-
4 years ago
3
camelCase2snake_case
PCRE2 (PHP >=7.3)
Convert camelCase to snake_case def camelCase2snake_case(txt): """ Convert camelCase to snake_case https://regex101.com/library/wUcSv4...
Submitted by
JV-conseil
-
2 years ago
3
Discord ID:NAME#DISCRIM match
PCRE2 (PHP >=7.3)
For example, using `Carl-bot to dump members of the @everyone role ordering highest of id`: `!dump @everyone %i:%u -o id` Example of return: 498984530968051713:lanjt#2129 ......
Submitted by
lanjt
-
3 years ago
3
example
PCRE2 (PHP >=7.3)
example
Submitted by
anonymous
-
3 years ago
3
Extract URL parts only named capturing groups
Golang
Extract URL parts only named capturing groups
Submitted by
dixanms
-
3 years ago
3
Match any layer bracket pair (.NET)
.NET 7.0 (C#)
Match any layer bracket pair
Submitted by
Yakumo Yukari
-
3 years ago
2
Task 4 Quiz
PCRE2 (PHP >=7.3)
It needs a major modification, since matching an integer is required. The accepted answer \d+ involves only "positive" integers. But -333 or +777 are also integers, which leads to two possible solutions with the last one being the most accurate: -?\d+ : The hyphen (optional minus sign) and a digit...
Submitted by
seQuienSoy
-
2 years ago
2
Mime type parser
.NET 7.0 (C#)
A "simple" regex to parse mime types. Handles all commonly occurring parts of a mime type string such as: Type Subtype Subtype's with an extra extension (e.g. svg+xml) (Optional input) Multiple parameters (Optional input)...
Submitted by
Vespion
-
2 years ago
(Last modified 2 years ago)
3
Remove extra/useless python elements for GPT input.
PCRE2 (PHP >=7.3)
This RegEx removes unused elements such as inline comments and blank lines in python code. This will save you tokens and time when using GPT-3+ or ChatGPT to help code and debug.
Submitted by
LukeL
-
2 years ago
(Last modified 2 years ago)
3
Caltrans EA validation with optional XX-XXXXXX entry and C##-#????#
.NET 7.0 (C#)
Checks validity of an EA number first two digits 01-12 followed by hyphen then a number from 0-4 and then 4 numbers or uppercase letters and ending in a 1 or 4 for example "05-1J7601". Adding a capital C to the beginning is also accepted "C05-1J7601", along with the entry of 2 X's hyphen and 6 X's ...
Submitted by
RDJ@Ct
-
2 years ago
(Last modified 2 years ago)
2
Discord Username (old & new)
PCRE2 (PHP >=7.3)
Accomodate for Discord's username changeover and match against either the old username or the new username. But only one or the other. Match: CesarHvl#9000 cesarhvl cesar.hvl...
Submitted by
cesarhvl
-
a year ago
3
Placeholder resolving
.NET 7.0 (C#)
.Net regular expression for resolving placeholders in the format of ${rewriter(multilevel:key)?fallback} (+ variations)
Submitted by
anonymous
-
a year ago
1
2
3
...
163
Community Library Entry
9
Regular Expression
Python
r"
(?=
^.
{4,253}
$
)
(
^
(
(?!
-
)
[
a
-
zA
-
Z0
-
9-
]
{1,63}
(?<!
-
)
\.
)+
[
a
-
zA
-
Z
]
{2,63}
$
)
"
Open regex in editor
Description
no description available
Submitted by
anonymous
-
9 years ago