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,400 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
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
106
601 upvotes, 495 downvotes (score 51.9%) (You must be signed in to vote)
trim
ECMAScript (JavaScript)
trim string
Submitted by
fp
-
10 years ago
2013-09-10 08:21
72
410 upvotes, 338 downvotes (score 56.4%) (You must be signed in to vote)
Regex for telephone numbers all over the world
Recommended
This entry has been specifically selected by our team to be a great submission
ECMAScript (JavaScript)
Detects most of the phone numbers all over the world
Submitted by
Aditya Joshi
-
10 years ago
2014-04-08 07:58
(Last modified 2 months ago)
2023-10-09 14:47
40
325 upvotes, 285 downvotes (score 49.3%) (You must be signed in to vote)
URL regexp
PCRE (PHP <7.3)
A quite neat regular expression for URLs, e-mails..., I found on Matthew O'Riordan's blog.
Submitted by
Matthew O'Riordan
-
11 years ago
2013-01-14 17:52
18
310 upvotes, 292 downvotes (score 52.3%) (You must be signed in to vote)
Date: DD-MM-YYYY hh:mm:ss
Recommended
This entry has been specifically selected by our team to be a great submission
PCRE (PHP <7.3)
Validate and capture dateTime parts, includes validation for leap years, range 1000-2999. Fixed bug
Submitted by
Ka.
-
11 years ago
2013-05-17 13:07
86
297 upvotes, 211 downvotes (score 54.1%) (You must be signed in to vote)
Password Validation
ECMAScript (JavaScript)
Checks that a password has a minimum of 6 characters, at least 1 uppercase letter, 1 lowercase letter, and 1 number with no spaces.
Submitted by
Christian Klemp
-
8 years ago
2015-07-08 18:46
35
236 upvotes, 201 downvotes (score 49.3%) (You must be signed in to vote)
http://
PCRE (PHP <7.3)
no description available
Submitted by
Mitus M.
-
10 years ago
2014-03-26 06:44
51
191 upvotes, 140 downvotes (score 52.3%) (You must be signed in to vote)
Disorted Email Addresses
PCRE (PHP <7.3)
Matches distorted email addresses and converts them back to real ones.
Submitted by
dislick
-
11 years ago
2013-01-16 14:11
81
178 upvotes, 97 downvotes (score 58.9%) (You must be signed in to vote)
Distinguish torrent files (series vs movies)
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 prev...
Submitted by
Firas Dib
-
9 years ago
2014-06-26 09:59
(Last modified 4 months ago)
2023-07-20 15:08
6
150 upvotes, 144 downvotes (score 45.3%) (You must be signed in to vote)
Password
ECMAScript (JavaScript)
no description available
Submitted by
anonymous
-
10 years ago
2013-12-06 14:02
(Last modified 4 months ago)
2023-07-21 04:59
31
142 upvotes, 111 downvotes (score 50%) (You must be signed in to vote)
Email address (most used)
ECMAScript (JavaScript)
Email address, most used cases
Submitted by
Jago
-
8 years ago
2015-07-01 09:32
34
123 upvotes, 89 downvotes (score 51.3%) (You must be signed in to vote)
Google like regex
ECMAScript (JavaScript)
Attempts to mimic Google search box behavior, returning an array with the separated search strings (that keep the +/- indicator for following operations)
Submitted by
mettjus
-
10 years ago
2014-05-12 13:35
18
119 upvotes, 101 downvotes (score 47.5%) (You must be signed in to vote)
Email validation
PCRE (PHP <7.3)
no description available
Submitted by
tutsplus.com
-
9 years ago
2014-09-16 13:45
16
101 upvotes, 85 downvotes (score 47.1%) (You must be signed in to vote)
Alphanumeric Regex
PCRE (PHP <7.3)
no description available
Submitted by
Deepan
-
8 years ago
2015-06-15 13:57
4
95 upvotes, 91 downvotes (score 43.9%) (You must be signed in to vote)
Phone number
PCRE (PHP <7.3)
no description available
Submitted by
Mark Landry
-
8 years ago
2015-06-23 19:15
14
92 upvotes, 78 downvotes (score 46.6%) (You must be signed in to vote)
Phone Number
ECMAScript (JavaScript)
Allows phone numbers with optional country code, optional special characters and whitespace
Submitted by
Tlmader
-
8 years ago
2015-08-11 17:07
26
91 upvotes, 65 downvotes (score 50.5%) (You must be signed in to vote)
match valid JSON
PCRE (PHP <7.3)
Matches any valid JSON object, matches recursively. Passes all JSON test cases I found.
Submitted by
Mateon1
-
9 years ago
2014-11-17 20:47
16
90 upvotes, 74 downvotes (score 47.2%) (You must be signed in to vote)
Password
ECMAScript (JavaScript)
Safe Password that allow only with a number, a lowercase, a uppercase, and a special character
Submitted by
davidlondono
-
9 years ago
2015-04-28 16:49
23
88 upvotes, 65 downvotes (score 49.6%) (You must be signed in to vote)
userName
PCRE (PHP <7.3)
1-15 alphanumeric login name
Submitted by
gsanchezc
-
8 years ago
2015-06-06 08:00
1
2
3
4
...
870
CSV line parsing
28
77 upvotes, 49 downvotes (score 52.4%) (You must be signed in to vote)
Regular Expression
PCRE (PHP <7.3)
/
(?:
\s
*
(?:
\"
(
[^
\"
]
*
)
\"
|
(
[^
,
]
+
)
)
\s
*
,
?
)+
?
/
g
Open regex in editor
Description
Loading markdown...
Submitted by
Various
-
9 years ago
2014-10-15 13:22