Please enable JavaScript to use regex101
Regular
Expressions
101
Support Regex101
Social
Info
Regex Editor
Community Library
Account
Regex Quiz
Order By
Most Recent
Most upvotes
Most downvotes
Highest Score
Lowest Score
Filter by Flavor
PCRE2 (PHP)
JavaScript
Python
Golang
Java
.NET 10.0 (C#)
Rust
POSIX ERE
POSIX BRE (grep/sed)
PCRE (Legacy)
Sponsors
Learn to code interactively with bite-sized, hands-on programming challenges.
Community Library
Search community submissions...
0/512
2
Validate color with grb group
Created
·
2026-02-03 03:22
Updated
·
2026-02-04 03:36
Type
·
Match
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
1
Check valid URI Scheme according to RFC2396
Created
·
2026-01-17 07:52
Type
·
Match
Flavor
·
Golang
Simple prefix matcher for validating URI Schemes according to [RFC2396, Section 3.1]( http://www.faqs.org/rfcs/rfc2396.html#3.5:~:text=well%20as%20%22http%22%29.-,scheme%20%20%20%20%20%20%20%20%3D%20alpha%20*%28%20alpha%20%7C%20digit%20%7C%20%22%2B%22%20%7C%20%22%2D%22%20%7C%20%22.%22%20%29,-Relative%20URI%20references) Go Playground: https://go.dev/play/p/vtYEugsNAfo
Submitted by
Gwyneth Llewelyn
1
cApStAn OmegaT flagged / disallowed text
Created
·
2026-01-11 22:28
Type
·
Match
Flavor
·
Java
Flagged / disallowed text expression used in cApStAn's build of OmegaT
Submitted by
msoutopico
1
cApStAn OmegaT custom tags
Created
·
2026-01-11 22:26
Type
·
Match
Flavor
·
Java
Custom tags expression used in cApStAn's build of OmegaT
Submitted by
msoutopico
1
普罗米修斯解析匹配
Created
·
2025-09-27 07:04
Type
·
Match
Flavor
·
Java
"^([\w_]+)(?:\{(*)\})?\s+([\d\\.e+-]+)(?:\s+(\d+))?$"gm
Submitted by
umanan
1
Keep Talking and Nobody Explodes - Passwords
Created
·
2025-07-18 05:15
Type
·
Unit Tests
Flavor
·
Rust
See the chapter On the Subject of Passwords in Bomb Defusal Manual
Submitted by
prprnya
1
1
Created
·
2025-07-09 00:30
Updated
·
2025-07-09 00:33
Type
·
Match
Flavor
·
Golang
https://regex101.com/r/hIak43/1
Submitted by
1
1
Alpha
Created
·
2025-06-08 16:09
Type
·
Match
Flavor
·
Golang
W alpha/
Submitted by
Furkan
1
OpenSearch + ElasticSearch minimum_should_match pattern
Created
·
2025-03-13 10:17
Type
·
Match
Flavor
·
Java
Validation pattern to validate the minimum_should_mach value in opensearch and elasticsearch queries. For more information on the minimum_should_match field have a look here for opensearch or here for elasticsearch
Submitted by
Hackante
1
ip with port
Created
·
2025-02-16 23:19
Type
·
Match
Flavor
·
Golang
Parse the typical connection string address like 123.123.123.123:123, supports the correct port and octet range
Submitted by
Anonymous
2
Discord IP Blocker
Created
·
2025-01-24 23:48
Updated
·
2025-01-24 23:56
Type
·
Match
Flavor
·
Rust
Blocks IPs that are sent in discord. Will block any IP, even if the numbers aren't in valid ranges (like 327.19.8.79) Has basic protections against whitespace
Submitted by
Bee3D
2
Discord emoji & Markdown links
Created
·
2024-12-14 18:33
Updated
·
2024-12-14 18:36
Type
·
Match
Flavor
·
Rust
NOTE The word text is used to substitute all alphanumeric characters as well as underscores (a-zA-Z0-9_]). Captures: [x] [text (the text in the parentheses doesn't get scanned) x] [text x] :text: Doesn't capture: [ ] [ ] [text] [ ] [text ] [ text ] [ text [ ] : text: [ ] :text : [ ] : text :
Submitted by
Anonymous
1
advent of code 2024 day3
Created
·
2024-12-04 02:37
Updated
·
2024-12-05 03:15
Type
·
Match
Flavor
·
Golang
regex of challenge
Submitted by
Marcell Martini
1
AOC 2024 D3 regex
Created
·
2024-12-03 11:28
Type
·
Match
Flavor
·
Rust
The regex to be used in both parts of adventofcode.com 2024 day 3 puzzle
Submitted by
dragmine149
1
Validate a comma separated list of IPv4 addresses, CIDRs, or IPv4 Ranges like 1.1.1.1-1.1.1.10
Created
·
2024-11-03 21:59
Type
·
Match
Flavor
·
Golang
Simple Regex to *validate * (no extraction!) an IPv4 Range which can be a comma separated mixture of IPv4 addresses IPv4 CIDRs IPv4 Ranges like 1.1.1.1-1.1.1.10 Examples : 192.168.1.1,255.255.255.255/32,10.10.10.10/24,0.0.0.0/24 192.168.1.1/32 192.168.1.1 192.168.1.1/32 192.168.1.1/12 192.168.1.1/24 192.168.1.1/24 192.168.1.1/0,192.168.1.1/0 10.0.0.0/24 172.16.0.1-172.16.0.255 192.168.1.1,10.0.0.1/24,172.16.0.1-172.16.0.10 64.33.232.212 64.33.232.210/24
Submitted by
alucab
1
ISO 8601 DURATION - Terraform Validation
Created
·
2024-10-10 22:19
Type
·
Match
Flavor
·
Golang
This is made to validate an ISO 8601 input in a Terraform variable validation block: validation { condition = can(regex("^P(\\d+Y)?(\\d+M)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+S)?)?$", var.value)) error_message = "The value must be a valid ISO 8601 duration string representing time. (e.g. PT1M, PT1H30M, PT30S, etc.)" }
Submitted by
Anonymous
1
Slash Separated Numbers
Created
·
2024-10-08 18:12
Type
·
Match
Flavor
·
Golang
...
Submitted by
Anonymous
1
vozuskia (cs/sk)
Created
·
2024-09-12 15:35
Type
·
Substitution
Flavor
·
Java
Addes a non-breaking space after any of the letters included in the [vozuskia] class.
Submitted by
Manuel Souto Pico
1
Split Docker image into image name, tag and digest with all optional
Created
·
2024-08-27 08:22
Type
·
Match
Flavor
·
Golang
Splits a Docker image string into the separate parts: image, tag, digest tag and digest are optional
Submitted by
Roemer
1
Discord Server Invite, Rust RegEx
Created
·
2024-06-26 07:33
Type
·
Match
Flavor
·
Rust
A regular expression for Rust that matches against Discord server invite URLs, but not those without an actual code present. This may be used in Discord's AutoMod feature as it supports up to 10 Rust regular expressions per custom rule.
Submitted by
sepruko
1
JS/TS imports of external dependencies
Created
·
2024-06-25 08:26
Type
·
Match
Flavor
·
Rust
This regex can be used on a JavaScript/TypeScript file to find imports from third-party packages. This is useful for determining what to put in dependencies/peerDependencies. This is a Rust regex, which makes it easy to use with rg (ripgrep). Pro tip: combine rg with sort -u to get a list of all packages for your JS/TS project! Based on a similar PCE2 regex
Submitted by
Nikita Karamov
1
YouTube Video ID
Created
·
2024-05-20 13:58
Type
·
Match
Flavor
·
Java
Gets the ID of a YouTube Video from any link to it.
Submitted by
cheeseburger
1
"fake" markdown link detection
Created
·
2024-04-25 18:42
Updated
·
2024-04-26 18:15
Type
·
Match
Flavor
·
Rust
This regex catches markdown links where the display text is also a link, like this: \example.com in order to prevent people getting tricked and clicking on a link that isn't what it says it is. See the test string for a much longer explanation with examples.
Submitted by
Osh
1
Parse Address - Prefecture
Created
·
2024-03-20 03:46
Type
·
Match
Flavor
·
Java
get prefecture from Japanese address
Submitted by
Gary Ascuy
1
AWS EventBridge Scheduling Expressions
Created
·
2024-03-13 19:19
Updated
·
2024-04-25 23:00
Type
·
Unit Tests
Flavor
·
Java
This validates AWS EventBridge scheduling expressions using the rate() and cron() formats. It may not catch all invalid expressions, but it should properly validate all valid expressions, as demonstrated in the unit tests. Please let me know if I missed any valid expressions. Originally attempted this using named capture groups and named back-references to reduce duplication. Unfortunately, named capture support is tricky, so they were all converted to duplicated non-capturing groups instead.
Submitted by
Evan S Kaufman <evan@evanskaufman.com>
1
IANA Media Type
Created
·
2024-02-22 19:45
Type
·
Match
Flavor
·
Java
Parses an IANA Media Type value. Doesn't seem to capture repeating parameters, which is a bit of an edge case but valid I think - any suggestions on how to fix would be appreciated.
Submitted by
scottbdr
2
Discord Anti-Advertisement 2
Created
·
2023-12-18 13:25
Updated
·
2024-01-23 15:38
Type
·
Match
Flavor
·
Rust
Pair this with my Discord AutoMod Anti Advertisement for full protection against invites. Use this with Discord's Built In AutoMod.
Submitted by
dogknife
2
Discord Anti Advertisement
Created
·
2023-12-17 20:34
Updated
·
2024-01-23 17:37
Type
·
Match
Flavor
·
Rust
Discord AutoMod Regex Use this Regex with Discord's built-in automod to prevent all invite URLs. This will block discord.gg/ad but not .gg/ad Consider seeing my "strict" version otherwise.
Submitted by
dogknife
2
Discord AutoMod Advert (Strict)
Created
·
2023-12-17 01:36
Updated
·
2024-01-23 17:37
Type
·
Match
Flavor
·
Rust
Use this with Discord automod. Bear in mind, this is "Strict" because it will block discord.gg/myad AND other links such as dsc.gg/myad
Submitted by
dogknife
1
文件名称验证
Created
·
2023-12-01 16:03
Type
·
Match
Flavor
·
Java
操作系统文件名称验证,参考了Windows,Linux,Mac
Submitted by
腾龙问天
1
verifyIPV6
Created
·
2023-11-20 15:18
Type
·
Match
Flavor
·
Java
verificare indirizzo IPV6 (regole base)
Submitted by
Luigi Piccinni
2
Check Email Validity
Created
·
2023-11-15 10:54
Updated
·
2023-11-15 17:35
Type
·
Match
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>
1
Gradient for minecraft
Created
·
2023-11-14 09:00
Type
·
Match
Flavor
·
Java
This is for my plugin project
Submitted by
Trần Thế Anh
1
Rust type-like ident casing
Created
·
2023-11-04 19:35
Type
·
Match
Flavor
·
Rust
Matches built-in primitives and identifiers with casing conventionally used for type/constant names.
Submitted by
Neel Yadav
1
Kafka loki parser
Created
·
2023-10-24 21:34
Type
·
Match
Flavor
·
Golang
Kafka loki parser
Submitted by
Anonymous
2
Rust Phone Number
Created
·
2023-10-23 21:47
Type
·
Match
Flavor
·
Rust
not fully featured, but simple.
Submitted by
Jakersnell
1
Youtube Video ID
Created
·
2023-10-18 07:16
Updated
·
2023-10-26 14:06
Type
·
Match
Flavor
·
Java
Extract youtube video ID
Submitted by
Anonymous
1
Extract text strings from repeating text fields followed by a suffix
Created
·
2023-09-22 11:56
Type
·
Match
Flavor
·
Java
This regex expression is useful for extracting only the text string from a value in a column that may contain values from individual rows with repeat strings tagged with a suffix. For example - Row 1: "Sales (#1)", Row 2: "Sales Match (#2)". From the shared examples, this regex will extract the text "Sales" and "Sales Match."
Submitted by
nilotpalc
2
CSV
Created
·
2023-09-09 10:06
Type
·
Match
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
1
0x28C6A6DdF8fF8A47A90A69bfE75cd89904a14d71
Created
·
2023-09-02 02:02
Type
·
Match
Flavor
·
Golang
0x28C6A6DdF8fF8A47A90A69bfE75cd89904a14d71
Submitted by
Anonymous
1
Match many cases of 8601
Created
·
2023-08-31 11:08
Updated
·
2023-08-31 14:32
Type
·
List Substitution
Flavor
·
Java
This is still a working in progress Need to do Unit Tests and search for more use cases Match partial cases of 8601 such as: missing offset missing time only date and offset nano present or not (and being from 1 digit to 9 digits) Also properly captures the data by capturing only: year, month, date, hour, minute, second, nano and offset (be it 'Z' or '+02:00' or' +0200')
Submitted by
jpmand
1
Extract any link or endpoint
Created
·
2023-08-25 22:32
Updated
·
2023-08-27 08:35
Type
·
Match
Flavor
·
Java
Extract any link or endpoint from 1- HTML page source 2- HTTP responses 3- JS files Feel free to contact me on Telegram https://t.me/c4ir0 if you: are interested in discussing this regex need assistance with any regex-related queries want to challenge me (I'm enthusiastic about this part)
Submitted by
Cairo
2
Mikrotik firewall logs
Created
·
2023-08-11 19:09
Updated
·
2023-08-11 21:09
Type
·
Match
Flavor
·
Golang
Matching for mikrotik ROS 7 Used in promtail and grafana
Submitted by
Anonymous
1
html <Title>
Created
·
2023-08-09 16:02
Type
·
Match
Flavor
·
Java
htnle
Submitted by
erichologist
-2
Ascending and Descending order
Created
·
2023-07-17 15:51
Type
·
Match
Flavor
·
Java
This regex is to match Ascending or descending order of 8 digit number
Submitted by
Anonymous
0
Capturing groups with suffix
Created
·
2023-07-17 08:05
Type
·
Match
Flavor
·
Java
Capturing the content of column names which are duplicate in nature to extract the actual name and suffix ("right" / "left")
Submitted by
Anonymous
-1
Dart relative import
Created
·
2023-07-11 13:37
Type
·
Match
Flavor
·
Java
find dart relative import path
Submitted by
sagarpanchal
0
Catch packages from 'tdnf list' output
Created
·
2023-06-26 18:42
Type
·
Match
Flavor
·
Golang
Every valid line will be of the form: . . . NOTE: the distribution tag is expected to start with at least one letter and be followed by at least one digit.
Submitted by
Anonymous
-2
rustyms: pro forma single modification
Created
·
2023-06-21 21:59
Type
·
Match
Flavor
·
Rust
The regex to match a single pro forma modification with all its intricacies.
Submitted by
Douwe Schulte
0
Cover dates from 2009 and older in French format and English
Created
·
2023-06-19 17:38
Type
·
Match
Flavor
·
Java
Covering Dates starting from year 2009 and older in French and English Some of the valid Dates format April 2nd 2008 April 2 2008 April 02 2008 2009-01-01 31-03-2009 03-31-2009 31 March 2009 March 31 2009 31 mars 2009 May 10th 1989 April 2nd 2008 2009.01.01 2009 1 31 31st december 2009 31 décembre 2009 31 Decembre 2009 2009/02/01 2009.01.01 2009 01 01 31 03 2009 12 31 2009
Submitted by
Francois-Alexandre Valade-Casaubon
Load More
Community Library Entry
1
Regular Expression
Open Workspace
"
&
(
#
[
a
-
fA
-
F0
-
9
]
{6}
)(
(?:
-#
[
a
-
fA
-
F0
-
9
]
{6}
)+
)(
(?:
&
[
k
-
oK
-
OrR
]
)+
)?(
.
*?
)(?=
(
&#
[
a
-
fA
-
F0
-
9
]
{6}
|
&
[
a
-
fA
-
Fk
-
oK
-
OrR0
-
9
]
)
|
$
)
"
gm
Description
Created
·
2023-11-14 09:00
Type
·
Match
Flavor
·
Java
This is for my plugin project
Submitted by
Trần Thế Anh
Open Workspace