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 20 community submitted regex patterns...
2
Rust Phone Number
Created
·
2023-10-23 21:47
Flavor
·
Rust
not fully featured, but simple.
Submitted by
Jakersnell
2
Discord AutoMod Advert (Strict)
Created
·
2023-12-17 01:36
Updated
·
2024-01-23 17:37
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
2
Discord Anti Advertisement
Created
·
2023-12-17 20:34
Updated
·
2024-01-23 17:37
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 Anti-Advertisement 2
Created
·
2023-12-18 13:25
Updated
·
2024-01-23 15:38
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 emoji & Markdown links
Created
·
2024-12-14 18:33
Updated
·
2024-12-14 18:36
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
2
Discord IP Blocker
Created
·
2025-01-24 23:48
Updated
·
2025-01-24 23:56
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
1
Get python function declaration
Created
·
2023-05-01 17:57
Flavor
·
Rust
Gets the python function declarations
Submitted by
anonymous
1
Prometheus Exposition metric line
Created
·
2023-05-30 09:41
Flavor
·
Rust
Prometheus exposition metric line format. Parses metric lines with named capture groups for metric name, labels, value, and timestamp. Excludes comment, type, and help lines. https://prometheus.io/docs/instrumenting/exposition_formats/#line-format
Submitted by
james-jra
1
Rust type-like ident casing
Created
·
2023-11-04 19:35
Flavor
·
Rust
Matches built-in primitives and identifiers with casing conventionally used for type/constant names.
Submitted by
Neel Yadav
1
"fake" markdown link detection
Created
·
2024-04-25 18:42
Updated
·
2024-04-26 18:15
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
JS/TS imports of external dependencies
Created
·
2024-06-25 08:26
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
Discord Server Invite, Rust RegEx
Created
·
2024-06-26 07:33
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
AOC 2024 D3 regex
Created
·
2024-12-03 11:28
Flavor
·
Rust
The regex to be used in both parts of adventofcode.com 2024 day 3 puzzle
Submitted by
dragmine149
1
Keep Talking and Nobody Explodes - Passwords
Created
·
2025-07-18 05:15
Flavor
·
Rust
See the chapter On the Subject of Passwords in Bomb Defusal Manual
Submitted by
prprnya
0
Unicode Hexadecimal
Created
·
2023-05-17 21:24
Updated
·
2023-05-17 21:52
Flavor
·
Rust
Find hexadecimal numbers using Extended Unicode Support.
Submitted by
anonymous
-2
rustyms: pro forma single modification
Created
·
2023-06-21 21:59
Flavor
·
Rust
The regex to match a single pro forma modification with all its intricacies.
Submitted by
Douwe Schulte
-1
Grep from A to B
Created
·
2021-01-03 13:38
Updated
·
2023-07-25 15:34
Flavor
·
Rust
no description available
Submitted by
anonymous
Community Library Entry
0
Regular Expression
Created
·
2022-01-09 12:49
Flavor
·
PCRE2 (PHP)
/
^
(?<City>
.
*
)
\s
(?<State>
[^
\s\d
]
+
)
\s
?
(?<Zip>
[
0
-
9
\-
]
{5,}
)?
$
/
gm
Open regex in editor
Description
City State Zip
Submitted by
anonymous