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,760 community submitted regex patterns...
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
TV series season and episode names
PCRE (PHP <7.3)
This regex matches against season and series names
Submitted by
mikey
-
8 years ago
2015-08-16 00:43
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Variable name of code
PCRE (PHP <7.3)
To get a variable name from a source code: The variable name is before the '=' (equal sign) This is the way to detect. Problem: Only 1 variable can get from 1 line. Unfortunately, this can get variable between after "//" and before ";" too. I made this for fake script debugger. Just get variable fr...
Submitted by
Setsuna
-
8 years ago
2015-09-19 11:18
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Remove common numeric suffixes (eg: 40m, 60%)
PCRE (PHP <7.3)
Usage: "40%".replace(/\b([\d\.]+)mkb%/ig, '$1')
Submitted by
anonymous
-
8 years ago
2015-09-24 15:38
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Validate hex color
PCRE (PHP <7.3)
Validates hexadecimal color codes based on the following rule set: Optionally starting with a hash. 3 or 6 characters in length. Using the [0-9a-f] character set.
Submitted by
Nathaniel Blackburn
-
8 years ago
2015-12-02 11:14
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Jeff Test
PCRE (PHP <7.3)
Valid and Invalid emails
Submitted by
anonymous
-
8 years ago
2015-12-10 21:35
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
import url image
Python
import url image
Submitted by
bartimeys
-
8 years ago
2015-12-18 08:44
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
kenteken validator
PCRE (PHP <7.3)
validator voor kenteken vb: 11-AA-BB
Submitted by
Senne Root
-
8 years ago
2016-01-06 14:30
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Version Matcher
PCRE (PHP <7.3)
Matches version strings.
Submitted by
anmols
-
8 years ago
2016-01-25 18:44
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
DNS hostname well-formedness validation
PCRE (PHP <7.3)
Validates that a DNS hostname is well-formed only. You will still need to check that the overall length of the hostname, including the implied trailing "." (if not present), does not exceed 255 bytes.
Submitted by
Jeff Walter
-
8 years ago
2016-03-10 19:44
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
MasterCard validate 2017
PCRE (PHP <7.3)
Match a MasterCard with new range for 2017: 51-55 and 2221-2720 @incarnated
Submitted by
John C
-
8 years ago
2016-03-22 03:14
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
CloudFlare
PCRE2 (PHP >=7.3)
Cloud Flare
Submitted by
anonymous
-
2 years ago
2021-06-29 16:27
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Email
PCRE2 (PHP >=7.3)
email format control
Submitted by
ahmetbarut
-
2 years ago
2021-07-10 13:06
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Validate Argentinian postal code
PCRE (PHP <7.3)
Validates CPA (Código Postal Argentino, spanish for Argentinian Postal Code).
Submitted by
Agustín Bouillet
-
8 years ago
2016-05-28 13:57
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Validates argentinian postal code
PCRE (PHP <7.3)
Validates the two valid postal codes in Argentina
Submitted by
Agustín Bouillet
-
8 years ago
2016-05-28 14:05
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
,(?=([^\"]*\"[^\"]*\")*(?![^\"]*\"))
PCRE (PHP <7.3)
no description available
Submitted by
anonymous
-
8 years ago
2016-05-31 12:17
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
remove blank keys in query string
PCRE (PHP <7.3)
looks for blank keys in the query string and remove it, in order to make shorter request.
Submitted by
M.Nizam
-
7 years ago
2016-07-03 12:36
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Credit Card Validation - MasterCard, Visa, Amex, Discover
PCRE (PHP <7.3)
MasterCard - ^5[1-5]\d+ Visa - ^4\d+ Amex - ^3[47]\d+ Discover - 6011|65|64...
Submitted by
Eric Foster
-
7 years ago
2016-07-09 21:06
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
INI Parser
PCRE (PHP <7.3)
Created for purpose of reading an INI file in C# applications. Supports comments and comment escape characters. I plan to add more escape characters (such as \=). s - Section scp - Section Comment Prefix sc - Section Comment...
Submitted by
Raxdiam
-
4 years ago
2020-03-03 01:56
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
9
15 upvotes, 6 downvotes (score 50%) (You must be signed in to vote)
Removing an XML Nodes namespace prefix from a XML string wit
PCRE (PHP <7.3)
no description available
Submitted by
anonymous
-
10 years ago
2013-11-23 16:21
1
2
3
4
5
6
7
...
688
Credit Card Validation - MasterCard, Visa, Amex, Discover
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Regular Expression
PCRE (PHP <7.3)
/
(
^
5
[
1
-
5
]
|
^
4
|
^
3
[
47
]
)
|
(
^
6011
|
65
|
64
[
4
-
9
]
|
622
(
1
(
2
[
6
-
9
]
|
[
3
-
9
]
\d
)
|
[
2
-
8
]
\d
{2}
|
9
(
[
01
]
\d
|
2
[
0
-
5
]
)
)
)
\d
+
/
g
Open regex in editor
Description
Loading markdown...
Submitted by
Eric Foster
-
7 years ago
2016-07-09 21:06