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 17,120 community submitted regex patterns...
483
1566 upvotes, 1083 downvotes (score 57.2%) (You must be signed in to vote)
regex101.com id grabber
PCRE (PHP <7.3)
grabs the ID for the regex101.com permalink to code
Submitted by
chris mccoy
-
10 years ago
2013-12-12 13:09
(Last modified 4 months ago)
2023-07-19 16:25
13
24 upvotes, 11 downvotes (score 57.2%) (You must be signed in to vote)
Match Gmail Email
Recommended
This entry has been specifically selected by our team to be a great submission
PCRE (PHP <7.3)
Match Gmail Email
Submitted by
Óscar EnrÃquez
-
9 years ago
2014-11-20 23:58
236
717 upvotes, 481 downvotes (score 57%) (You must be signed in to vote)
Matching email addresses per RFC5322
PCRE (PHP <7.3)
The BNF rules from RFC 5322 transformed to PCRE by Nikita Popov and described in the post http://nikic.github.io/2012/06/15/The-true-power-of-regular-expressions.html.
Submitted by
Michael Musson
-
10 years ago
2013-10-23 17:46
10
13 upvotes, 3 downvotes (score 57%) (You must be signed in to vote)
MikroTik FireWall
PCRE (PHP <7.3)
Regex used in Splunk to extract fields from Mikrotik FW. NOTES: Mikrotik must be configured to use "BSD Syslog" format FW rules must add, as log prefix, the action: drop accep...
Submitted by
HappyIdeasMaker
-
9 years ago
2015-05-30 10:27
13
19 upvotes, 6 downvotes (score 56.6%) (You must be signed in to vote)
Credit Card Expiry Date
ECMAScript (JavaScript)
Allows inserting expiry date as MM/YYYY or MM-YYYY format
Submitted by
Rider
-
9 years ago
2015-05-26 05:34
12
17 upvotes, 5 downvotes (score 56.6%) (You must be signed in to vote)
US Currency Format
ECMAScript (JavaScript)
no description available
Submitted by
anonymous
-
8 years ago
2016-01-23 17:46
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
Find All Python imports
PCRE (PHP <7.3)
no description available
Submitted by
anonymous
-
9 years ago
2014-10-07 12:03
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
relative to absolute
PCRE (PHP <7.3)
relative to absolute
Submitted by
xp_prg
-
9 years ago
2015-01-20 01:16
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
IOS3166 Country Code Identification REGEX
Python
IOS3166 Country Code Identification REGEX
Submitted by
theitgeek@recu.org.uk
-
8 years ago
2015-06-07 04:48
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
Quartz Cron Validation
PCRE (PHP <7.3)
http://stackoverflow.com/questions/2362985/verifying-a-cron-expression-is-valid-in-java
Submitted by
anonymous
-
8 years ago
2015-07-27 12:13
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
IP Address (with 0s)
ECMAScript (JavaScript)
Matches all valid IP addresses from 0.0.0.0 to 255.255.255.255
Submitted by
Ryan Plummer
-
8 years ago
2015-09-28 21:24
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
Codice fiscale italiano
PCRE (PHP <7.3)
Oltre a supportare le omocodie controlla in modo restrittivo il carattere relativo al mese di nascita
Submitted by
Aldo Medri
-
8 years ago
2015-10-09 09:14
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
look for any $_POST['name']
PCRE (PHP <7.3)
if you are as lazy as me and want to replace every "=$_POST['name'];" using Dreamweaver or any development tool that allows using regular expressions to search in current file/document.
Submitted by
Kevinator
-
8 years ago
2016-01-14 23:35
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
Form Tag
Python
Form Tag
Submitted by
Jay Patel
-
8 years ago
2016-02-26 06:49
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
psswd
Python
no description available
Submitted by
anonymous
-
8 years ago
2016-03-24 09:04
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
Find and extract email domain
Python
Find and extract email domain. Ex: test@example.pt -> extract 'example.pt'
Submitted by
Fnxk
-
8 years ago
2016-04-03 17:03
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
Match Only Text
Python
no description available
Submitted by
anonymous
-
7 years ago
2016-07-05 03:56
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
get specific value from html tag
PCRE (PHP <7.3)
no description available
Submitted by
A.ROA
-
7 years ago
2016-09-25 06:08
7
8 upvotes, 1 downvotes (score 56.5%) (You must be signed in to vote)
extract subdomain(if available) or domain from URL
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
-
8 years ago
2016-04-08 13:05
7
8 upvotes, 1 downvotes (score 56.5%) (You must be signed in to vote)
validate US (5 & 9 digit) ZipCodes and CA PostalCodes
PCRE (PHP <7.3)
no description available
Submitted by
anonymous
-
9 years ago
2015-05-15 18:00
1
2
3
4
5
...
856
Match Only Text
5
5 upvotes, 0 downvotes (score 56.6%) (You must be signed in to vote)
Regular Expression
Python
r"
(
\w
+
)
(
[
\W
+^
\s
]
)
"
ig
Open regex in editor
Description
Loading markdown...
Submitted by
anonymous
-
7 years ago
2016-07-05 03:56