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 4,320 community submitted regex patterns...
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
IPv6 detection
Python
It's too large to match with all which seems like an IPv6. It's not perfect, but it's detects more valid IPv6 than some others regex.
Submitted by
Ajabep
-
7 years ago
2016-08-15 13:31
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
.*(\d+).* Selects last number
Python
no description available
Submitted by
anonymous
-
7 years ago
2016-09-13 20:27
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
Ansible Host Var checking
Python
We had an issue where the "hosts=some_var" value could cause mass deployments if the wrong value was passed through. Specifically a comma with nothing surrounding it (i.e. "hosts=,"). This regex will allow us to fail when certain characters are present.
Submitted by
anonymous
-
7 years ago
2017-02-10 19:33
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
URL parser
PCRE2 (PHP >=7.3)
The best way to parse URL via Regex. This can be used in javascript, PHP, etc.
Submitted by
Ivijan-Stefan Stipic
-
7 years ago
2017-03-08 06:26
(Last modified 4 months ago)
2023-07-20 23:11
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
Max 30 Characters excluding brackets
PCRE2 (PHP >=7.3)
This is a simple regex for 30 characters limit excluding brackets
Submitted by
jusuchin85
-
2 years ago
2022-04-27 06:27
(Last modified 2 years ago)
2022-04-27 06:46
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
Extract Rapidgator Links from a HTML web page (Works for rg.to and rapidgator.net)
PCRE2 (PHP >=7.3)
Click "open regex in editor" to open regex. Open a webpage containing Rapidgator Links - Either rg.to or rapidgator.net Right-click anywhere on the page and select "view page source" Copy the HTML markup containing the Rapidgator links to regex101.com Paste the HTML markup and set mode to match Loca...
Submitted by
SmartCoder
-
2 years ago
2022-05-26 17:44
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
Detect RGB/RGBA colors in CSS
PCRE2 (PHP >=7.3)
JS function to convert RGB(A) to HEX color for single values: /** @param {string} color the RGB(A) color @return {string} the HEX color */ function rgba2hex(color)...
Submitted by
WinterSilence
-
a year ago
2022-05-31 10:30
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
US Social Security Number
PCRE2 (PHP >=7.3)
Finds a number that is 9 digits long. Can have spaces or hyphens in between the numbers and will still be found
Submitted by
anonymous
-
a year ago
2022-06-08 15:43
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
Dice-Throwing notation
PCRE2 (PHP >=7.3)
You can express the required dice-throwing as usual: 1d10, 2d6, 3d8... The first part (dice number) is mandatory. So, notations like "D10" are not computed, and they must be written as 1d10 The dice number may be expressed as [number]o[number]. For example: 1o3d10. That will mark to implement a Gaus...
Submitted by
Hermes
-
a year ago
2022-07-10 10:57
(Last modified a year ago)
2022-07-10 11:14
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
HTML Minifier
PCRE2 (PHP >=7.3)
https://stackoverflow.com/questions/5312349/minifying-final-html-output-using-regular-expressions-with-codeigniter Thanks to @Alan Moore
Submitted by
anonymous
-
a year ago
2022-08-10 05:37
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
Parse conventional commits message
PCRE2 (PHP >=7.3)
https://conventionalcommits.org Parses commits like type(scope)!: subject
Submitted by
Alex Kinnee
-
a year ago
2022-08-29 23:59
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
Email with gmail+ implementation
PCRE2 (PHP >=7.3)
Regex of email with ability to add gmail's +example system example: root email = user@gmail.com gmail+ = user+extra@gmail.com
Submitted by
brad
-
a year ago
2022-09-02 18:33
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
Palindromes
PCRE2 (PHP >=7.3)
Matches palindromes: arbitrary length ignores non-significant characters (spaces, ponctuation) ignores accents, provided the text is NFD-normalized recursive palindromes (e.g. "a été à"): either match the longest one ("a été à") or the nested ones individually ("a", "été", "à") (see comment)
Submitted by
NicolaF_
-
10 months ago
2023-02-01 17:47
(Last modified 10 months ago)
2023-02-02 08:27
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
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
-
10 months ago
2023-02-01 19:16
(Last modified 10 months ago)
2023-02-02 00:41
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
Python regular expression to detect any type of group link and private channel in Telegram
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
-
4 months ago
2023-07-23 15:57
(Last modified 4 months ago)
2023-07-24 15:49
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
IDN Domains and Subdomains
PCRE2 (PHP >=7.3)
IDN Domains & Normal Domains This regex is able to identify any type of domain or subdomain whether it is IDN or normal, this includes domains in emojis, non-Latin characters, etc.
Submitted by
NCK
-
4 months ago
2023-07-26 14:47
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
regex101: RFC1918 Private IPv4 Addresses, but limited to matching /24 subnet host IDs
PCRE2 (PHP >=7.3)
POSIX ERE compatible, suitable for usage in Bash [ testing Attributions Derived from [regex101: RFC1918 - Private IPv4 addresses by 0100101101001.
Submitted by
anonymous
-
3 months ago
2023-08-23 07:20
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
lottery data picker
Python
for azlottoapi
Submitted by
anonymous
-
3 years ago
2020-12-28 20:55
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
IpAddress
Python
Ensure the ip address format is correct
Submitted by
aaa
-
3 years ago
2021-01-14 09:00
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
Dutch zipcodes
PCRE2 (PHP >=7.3)
no description available
Submitted by
anonymous
-
3 years ago
2021-02-24 15:54
(Last modified 3 years ago)
2021-02-24 16:08
1
2
3
4
5
6
7
...
216
Basic grammar for regex matching of simplistic Makefiles
-2
3 upvotes, 5 downvotes (score 13.7%) (You must be signed in to vote)
Regular Expression
Python
r"
(?P<assign_op>
(
\:
|
\!
|
\?
)?
=
)
|
(?P<token_subst>
$
|
%
(
\<\@
)
)
|
(?P<token_ident>
[
\w\d
\.\,
]
+
)
|
(?P<target_name_match>
%
\.
?
)
|
(?P<token_rule_sep>
[
:
]
)
|
(?P<incr_op>
\n
)
|
(?P<line_end>
\n
)
|
(?P<comment_op>
#
[
.*
]
+
$
)
|
(?P<adjust_parser>
[
\$
%
\s\t
\:
]
)
"
gm
Open regex in editor
Description
Loading markdown...
Submitted by
Robert Butler <me@r-butler.net>
-
9 years ago
2014-08-13 01:11