Please enable JavaScript to use regex101
Regular
Expressions
101
Support Regex101
Social
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)
ECMAScript (JavaScript)
Python
Golang
Java
.NET 7.0 (C#)
Rust
PCRE (Legacy)
Sponsors
There are currently no sponsors.
Become a sponsor today!
Community Patterns
Search among community submitted regex patterns...
0/512
12
Conventional Commits validation
Created
·
2022-01-03 20:30
Updated
·
2022-04-05 20:20
Flavor
·
Python
This regex prevents the writing of non-standard conventional commits. I'm available on my github
Submitted by
Krisque
12
Find Reddit Threads
Created
·
2015-03-12 09:23
Flavor
·
Python
Simply searches for the thread-id in any kind of valid reddit-URL.
Submitted by
Mio
11
extract subdomain(if available) or domain from URL
Created
·
2016-04-08 13:05
Flavor
·
Python
This regex should extract the subdomain, if any, or the domain, if no subdomain is used, from an arbitrary URL
Submitted by
trevi@twanda.com
6
Find and extract email domain
Created
·
2016-04-03 17:03
Flavor
·
Python
Find and extract email domain. Ex: test@example.pt -> extract 'example.pt'
Submitted by
Fnxk
10
entity
Created
·
2015-11-20 01:12
Flavor
·
Python
no description available
Submitted by
anonymous
83
Distinguish torrent files (series vs movies)
Created
·
2014-06-26 09:59
Updated
·
2023-07-20 15:08
Flavor
·
Python
A neat regex for finding out whether a given torrent name is a series or a movie. Returns the full name of the series with the separator needed to make it pretty (ie, replace it with space or what you want). Also returns the season number or the year for the movie/series, depending on what was previously matched.
Submitted by
Firas Dib
5
C# Regex Extract/Match Nested HTML Elements/Tags
Created
·
2022-03-03 19:13
Updated
·
2023-08-01 07:26
Flavor
·
.NET 7.0 (C#)
With this C# regex, you can easily match/Parse Nested HTML tags. Example input: someTitle SomeHeader anotherHeader HelloWorld Output: anotherHeader HelloWorld string pattern = $@"{ startP }((?'nested'{ openP })|{ closeP }(?'-nested')|\w\W]?){ closeP }"; *'StartP' (Must include open tag), example: <div id="target" *'openP' example: <div *'closeP' example: </div References: [In Depth with RegEx Matching Nested Constructions In Depth with .NET RegEx Balanced Grouping Regular expression matches closed HTML tags (nesting is supported)
Submitted by
w4po
5
Match Only Text
Created
·
2016-07-05 03:56
Flavor
·
Python
no description available
Submitted by
anonymous
5
psswd
Created
·
2016-03-24 09:04
Flavor
·
Python
no description available
Submitted by
anonymous
5
Form Tag
Created
·
2016-02-26 06:49
Flavor
·
Python
Form Tag
Submitted by
Jay Patel
5
import url image
Created
·
2015-12-18 08:44
Flavor
·
Python
import url image
Submitted by
bartimeys
7
IOS3166 Country Code Identification REGEX
Created
·
2015-06-07 04:48
Flavor
·
Python
IOS3166 Country Code Identification REGEX
Submitted by
theitgeek@recu.org.uk
7
SO: fail2ban regular to find 403 request in nginx
Created
·
2014-09-15 11:32
Updated
·
2023-07-27 20:59
Flavor
·
Python
http://stackoverflow.com/q/25778420/2072035
Submitted by
anonymous
9
English date in "dd mmmm yyyy" format
Created
·
2015-05-18 19:41
Flavor
·
Python
Parse an English date following the "dd mmmm yyyy" format.
Submitted by
Tantale
4
Equation matching (without equal)
Created
·
2015-07-01 19:50
Flavor
·
Python
use this to get value of any side of an equation. You can combine this with https://regex101.com/r/fH5kJ1/1
Submitted by
Kerosene2000
8
repeat group match
Created
·
2015-07-24 21:02
Flavor
·
Python
no description available
Submitted by
anonymous
9
domain - host
Created
·
2015-09-29 17:50
Flavor
·
Python
no description available
Submitted by
anonymous
9
Extract Protocol, URL, URL Path, get parameters and hash from URI
Created
·
2014-05-22 23:34
Flavor
·
Python
This is simplified from my last submission.
Submitted by
Dale O'Brien
3
Placeholder resolving
Created
·
2023-10-07 19:39
Flavor
·
.NET 7.0 (C#)
.Net regular expression for resolving placeholders in the format of ${rewriter(multilevel:key)?fallback} (+ variations)
Submitted by
anonymous
3
Caltrans EA validation with optional XX-XXXXXX entry and C##-#????#
Created
·
2023-04-07 19:11
Updated
·
2023-04-07 19:51
Flavor
·
.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 "XX-XXXXXX"
Submitted by
RDJ@Ct
3
Match any layer bracket pair (.NET)
Created
·
2022-03-10 03:13
Flavor
·
.NET 7.0 (C#)
Match any layer bracket pair
Submitted by
Yakumo Yukari
3
Extract URL parts only named capturing groups
Created
·
2022-02-03 00:00
Flavor
·
Golang
Extract URL parts only named capturing groups
Submitted by
dixanms
3
Markdown Heading
Created
·
2021-12-14 21:41
Flavor
·
Java
Parses the text following a '#' and a space all the way up to the next return character. Additional #'s can be added for parsing of other type of headings!
Submitted by
Hansen
3
Hostname validation
Created
·
2017-01-29 01:16
Flavor
·
Golang
Validates subdomain, root domain, and wild card domains
Submitted by
AnonymousDapper
3
Thorough UK Postcode Validator with In/Out code capture groups
Created
·
2016-09-30 15:51
Flavor
·
Python
A more thorough UK postcode validator tested against all UK postcodes on a regular basis, but excluding the special GIRO postcode case out of personal preference. Additionally has capture groups for the In-code and Out-code sections. Requires case insensitive matching.
Submitted by
Chris G
3
Email
Created
·
2016-09-07 03:55
Flavor
·
Python
Python
Submitted by
anonymous
3
Capture Query Strings
Created
·
2016-05-15 10:22
Flavor
·
Python
A solution for capture query params.
Submitted by
Rafael Laurindo
3
iframe src parser
Created
·
2016-01-05 12:41
Flavor
·
Python
Get iframe src
Submitted by
Sumeet Fefar
3
Find URLs in markdown where the lines have been wrapped
Created
·
2014-08-26 21:13
Flavor
·
Python
no description available
Submitted by
anonymous
7
CSS Import
Created
·
2014-05-03 00:51
Flavor
·
Python
no description available
Submitted by
anonymous
5
Find consecutive duplicate words
Created
·
2015-08-31 22:17
Flavor
·
Python
no description available
Submitted by
anonymous
4
Bible reference extractor
Created
·
2016-04-04 08:31
Flavor
·
Python
For scraping http://skepticsannotatedbible.com/
Submitted by
antaytheist-owner
3
phone
Created
·
2015-05-07 17:14
Flavor
·
Python
matches: + example: +52 33 3884 7720 +1 770 343 5788
Submitted by
miqui
4
Complete imgur link regex
Created
·
2015-03-13 11:26
Flavor
·
Python
This regex grabs all kinds of imgur links and groups them in meaningful names aswell. This way you have full flow-control in your python-scripts.
Submitted by
Mio
3
Regex tutorial
Created
·
2020-07-01 10:00
Updated
·
2023-07-20 07:05
Flavor
·
Java
Case insensitive match the whole word betwween \bword\b
Submitted by
anonymous
3
prices in nis
Created
·
2015-06-15 15:16
Flavor
·
Python
no description available
Submitted by
molaxx
3
date time
Created
·
2014-01-29 03:45
Flavor
·
Python
1/Jul/2013 03:27:12
Submitted by
himel
3
Twitch URL Regex
Created
·
2015-03-15 12:53
Flavor
·
Python
Can grab all kinds of valid twitch URLs.
Submitted by
Mio
2
Validate color with grb group
Created
·
2026-02-03 03:22
Updated
·
2026-02-04 03:36
Flavor
·
Golang
match: #aabbcc #abc (255,255,255) (255,255,255,255) 255,255,255 no match: #gggggg #ggg 256,256,256
Submitted by
Doyoung
2
Command line parser
Created
·
2024-08-23 09:01
Updated
·
2024-08-23 10:28
Flavor
·
.NET 7.0 (C#)
Supports parameters such as keys and values, also parameters enclosed in quotes.
Submitted by
Pavel Bashkardin
2
Check Email Validity
Created
·
2023-11-15 10:54
Updated
·
2023-11-15 17:35
Flavor
·
Java
Regular expression to check the email syntax validity. Certainly requires improvement, but it's a good basis to work from. Work with Java and JavaScript.
Submitted by
Alain TOMASIAN <alain.tomasian@kaptus.fr>
2
CSV
Created
·
2023-09-09 10:06
Flavor
·
Java
Crude CSV regex to split only by characters surrounded by non-whitespace characters. Ignore that it dosen't highlight all of the other commas in the editor. If you select the g regex flag it will properly show here, but not work in Java. Credit to @merosity (Merosity#0135) on Discord!
Submitted by
Merosity, regice202
2
Mikrotik firewall logs
Created
·
2023-08-11 19:09
Updated
·
2023-08-11 21:09
Flavor
·
Golang
Matching for mikrotik ROS 7 Used in promtail and grafana
Submitted by
anonymous
2
Python regular expression to detect any type of group link and private channel in Telegram
Created
·
2023-07-23 15:57
Updated
·
2023-07-24 15:49
Flavor
·
Python
You can use this regular expression to identify any type of Telegram link. It doesn't matter whether it is t.me or telegram.me. Links including "joinchat" are also accepted.
Submitted by
Telegram : T.me/TinyPY
2
URL Regex
Created
·
2023-07-06 08:43
Updated
·
2023-07-06 08:45
Flavor
·
.NET 7.0 (C#)
Matches protocol, domain, port, path, query and anchor as named capturing groups.
Submitted by
Jonathan
2
golang re2 negative lookahead
Created
·
2023-04-21 10:28
Flavor
·
Golang
Aquivalent solution for golang's unsupported negative lookahead in re2 flavor of go's regex. This example provides a negative lookahead similar to (?!/api/) ignoring routes with the /api/ prefix at the start.
Submitted by
misha
2
Aus Mobile number
Created
·
2023-03-20 06:22
Flavor
·
.NET 7.0 (C#)
validates against multiple common formats
Submitted by
anonymous
2
Get ip address (only ipv4) Validator
Created
·
2023-02-20 18:43
Updated
·
2023-02-21 12:05
Flavor
·
.NET 7.0 (C#)
Get ip address (only ipv4) Validator
Submitted by
Mr.Tang
2
Phone number for all countries
Created
·
2023-02-07 07:33
Flavor
·
.NET 7.0 (C#)
Phone number for all countries. Valid symbols: ( ), -, whitespace
Submitted by
Alexander Smirnov
2
Replace sub-strings in string
Created
·
2023-01-01 01:47
Flavor
·
.NET 7.0 (C#)
Replace sub-strings in string
Submitted by
anonymous
Load More
Community Library Entry
3
Regular Expression
Created
·
2022-03-10 03:13
Flavor
·
.NET 7.0 (C#)
@"
\w
+
\(
[^
()
]
*
(
(
(?'parenthesesPair'
\(
)
[^
()
]
*
)+(
(?'-parenthesesPair'
\)
)
[^
()
]
*
)+
)*(?(parenthesesPair)
(?!)
)
\)
"
gm
Open regex in editor
Description
Match any layer bracket pair
Submitted by
Yakumo Yukari