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 13,720 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
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
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
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
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
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
28
77 upvotes, 49 downvotes (score 52.4%) (You must be signed in to vote)
CSV line parsing
PCRE (PHP <7.3)
Captures all fields from a CSV file's line. Can be customized with user-defined field separator and protecting character.
Submitted by
Various
-
9 years ago
2014-10-15 13:22
31
77 upvotes, 46 downvotes (score 53.8%) (You must be signed in to vote)
ninite
PCRE (PHP <7.3)
no description available
Submitted by
peek
-
8 years ago
2015-09-29 11:28
13
76 upvotes, 63 downvotes (score 46.4%) (You must be signed in to vote)
URL Validator
PCRE (PHP <7.3)
Validates - URLs with schemes - http, https and ftp Relative URL starting with / and ../
Submitted by
anonymous
-
9 years ago
2014-09-24 08:41
29
70 upvotes, 41 downvotes (score 53.8%) (You must be signed in to vote)
Wrap long string to spec length
PCRE (PHP <7.3)
no description available
Submitted by
fullpipe
-
10 years ago
2013-07-21 20:34
9
67 upvotes, 58 downvotes (score 44.9%) (You must be signed in to vote)
Youtube ID match
PCRE (PHP <7.3)
This regex will match any Youtube video ID thrown at it and return one capturing group containing the ID.
Submitted by
Jacob Overgaard
-
10 years ago
2013-11-28 13:30
3
65 upvotes, 62 downvotes (score 42.6%) (You must be signed in to vote)
Match quoted strings, ignoring escaped quotes
PCRE (PHP <7.3)
Matches single or double quoted strings, and ignores backslash-escaped quotes within the string.
Submitted by
Maddingue
-
10 years ago
2013-06-26 14:28
22
59 upvotes, 37 downvotes (score 51.5%) (You must be signed in to vote)
UK Postcode Checker
PCRE (PHP <7.3)
Checks for valid UK/British postcodes. There was another on here that had for some reason been upvoted, but it was actually incorrect as it worked on none of my valid own postcodes! Namely that it assumed two letters and a number (BS3) when you can have variations (M20). Allows for an optional spac...
Submitted by
MaffooBristol
-
9 years ago
2014-10-21 08:23
13
53 upvotes, 40 downvotes (score 46.8%) (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
-
9 years ago
2014-08-19 16:10
1
2
3
4
...
686
EmailValidation
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Regular Expression
PCRE2 (PHP >=7.3)
/
[
A
-
Za
-
z._
]
{3,}
@
[
A_Za
-
z
]
{3,10}
[
.
]
{1}
[
A
-
Za
-
z.
]
{2,6}
/
gm
Open regex in editor
Description
Loading markdown...
Submitted by
anonymous
-
6 months ago
2023-06-07 05:52