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 9,420 community submitted regex patterns...
5
13 upvotes, 8 downvotes (score 40.9%) (You must be signed in to vote)
ipv6 Validation
PCRE (PHP <7.3)
Handle all condition for ipv6 example: 1) FE80::8329 2) FE80::FFFF:8329 3) FE80::B3FF:FFFF:8329 4) FE80::0202:B3FF:FFFF:8329...
Submitted by
Lim Yew Teck, Nicholas
-
8 years ago
2015-09-04 16:46
5
19 upvotes, 14 downvotes (score 40.8%) (You must be signed in to vote)
Separate words (works with spaces, dashes and underscores)
PCRE (PHP <7.3)
no description available
Submitted by
marcoslhc
-
9 years ago
2014-10-07 17:30
4
7 upvotes, 3 downvotes (score 39.7%) (You must be signed in to vote)
Task 1
PCRE (PHP <7.3)
Finds a happy smile, except sad one
Submitted by
Kovalev Evgeny
-
10 years ago
2014-02-25 05:48
4
20 upvotes, 16 downvotes (score 39.6%) (You must be signed in to vote)
Element's Attribute Value in XML (simple)
PCRE (PHP <7.3)
Simple regular expression for extracting attribute value of the element in XML-string. Attribute value should be in quotes.
Submitted by
Nikita Danilov
-
9 years ago
2014-06-24 11:29
1
37 upvotes, 36 downvotes (score 39.5%) (You must be signed in to vote)
Validate alphanumeric and numeric range
PCRE (PHP <7.3)
For Validating alphanumeric and numeric range
Submitted by
anonymous
-
9 years ago
2014-09-22 09:13
4
19 upvotes, 15 downvotes (score 39.5%) (You must be signed in to vote)
Remove HTML tags
PCRE (PHP <7.3)
This regex is used to remove HTML tag on string
Submitted by
Jordane BACHELET
-
9 years ago
2014-10-01 08:36
0
41 upvotes, 41 downvotes (score 39.4%) (You must be signed in to vote)
URL matching
PCRE (PHP <7.3)
Complete url matching with storage of various parameters
Submitted by
hjpotter92
-
9 years ago
2014-07-02 06:34
4
17 upvotes, 13 downvotes (score 39.2%) (You must be signed in to vote)
Credit Card Number
PCRE (PHP <7.3)
Validates Credit Card Numbers of different type. Supports Visa, MasterCard, American Express, Diners Club, Discover and JCB Taken from http://www.regular-expressions.info/creditcard.html If you want to support only a particular type, customise it based on following....
Submitted by
Ehsan
-
8 years ago
2015-06-04 15:07
4
8 upvotes, 4 downvotes (score 39.1%) (You must be signed in to vote)
Strip out domain extensions except for Microsoft .net technologies.
PCRE (PHP <7.3)
no description available
Submitted by
anonymous
-
11 years ago
2013-03-25 17:26
4
8 upvotes, 4 downvotes (score 39.1%) (You must be signed in to vote)
YouTube Grabber Cleanup
PCRE (PHP <7.3)
no description available
Submitted by
anonymous
-
10 years ago
2013-09-22 15:13
4
8 upvotes, 4 downvotes (score 39.1%) (You must be signed in to vote)
html tags
PCRE (PHP <7.3)
no description available
Submitted by
anonymous
-
8 years ago
2016-04-07 18:24
4
8 upvotes, 4 downvotes (score 39.1%) (You must be signed in to vote)
Regex tutorial Case sensitive consonants
PCRE (PHP <7.3)
With regex you can count the number of matches. Can you make it return the number of uppercase consonants (B,C,D,F,..,X,Y,Z) in a given string? E.g.: it should return 3 with the text ABcDeFO!. Note: Only ASCII. We consider Y to be a consonant! Example: the regex /./g will return 3 when run against t...
Submitted by
anonymous
-
3 years ago
2020-07-01 10:38
4
15 upvotes, 11 downvotes (score 38.9%) (You must be signed in to vote)
Strip multi-line (star) comments from JavaScript, while leaving any CDATA sections intact.
PCRE (PHP <7.3)
This regular expression removes multi-line (star) comments from JavaScript, while leaving any CDATA sections intact. Use the global (g) modifier to match them all (if you plan to use PHP's preg_replace, the g modifier is not necessary), and use the (s) modifier to make dots match newlines (this will...
Submitted by
Dane MacMillan
-
11 years ago
2013-03-21 20:42
4
14 upvotes, 10 downvotes (score 38.8%) (You must be signed in to vote)
Get stuff inside <a> tags
PCRE (PHP <7.3)
Get stuff inside tags, which are between certain words
Submitted by
Jerry
-
10 years ago
2013-09-07 18:19
4
9 upvotes, 5 downvotes (score 38.8%) (You must be signed in to vote)
Mask credit card
PCRE (PHP <7.3)
no description available
Submitted by
Albert Paris
-
8 years ago
2016-01-14 11:11
4
10 upvotes, 6 downvotes (score 38.6%) (You must be signed in to vote)
utf-8 hex.
PCRE (PHP <7.3)
utf-8 hex. code armenian. Firs character regexp
Submitted by
Dyxx
-
9 years ago
2015-02-18 06:26
3
4 upvotes, 1 downvotes (score 37.6%) (You must be signed in to vote)
xferlog parser (proftpd, ftpd, vsftpd, etc..)
PCRE (PHP <7.3)
This pulls out all the fields from a standard xferlog format log. Format specified here http://www.castaglia.org/proftpd/doc/xferlog.html
Submitted by
Robin Kearney
-
9 years ago
2014-08-31 13:06
3
4 upvotes, 1 downvotes (score 37.6%) (You must be signed in to vote)
UUID
PCRE (PHP <7.3)
no description available
Submitted by
Jason
-
9 years ago
2014-09-03 13:30
3
4 upvotes, 1 downvotes (score 37.6%) (You must be signed in to vote)
Finds dates lacking period before month (Norwegian)
PCRE (PHP <7.3)
no description available
Submitted by
EB
-
9 years ago
2014-09-09 22:54
3
4 upvotes, 1 downvotes (score 37.6%) (You must be signed in to vote)
Get URL parameters
PCRE (PHP <7.3)
no description available
Submitted by
anonymous
-
9 years ago
2014-09-16 08:46
1
...
6
7
8
9
10
11
12
...
471
Go Gmail Date Reply Line
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Regular Expression
Golang
`
On
\s
[
a
-
z
]
{3}
,
\s
[
0
-
9
]
{1,2}
\s
[
a
-
z
]
{3,4}
\s
[
0
-
9
]
{4}
\s
at
\s
[
0
-
9
]
{1,2}
:
[
0
-
9
]
{1,2}
,
\s
[^
<
]
*
<
[
a
-
z0
-
9._%+
\-
]
+
@
[
a
-
z0
-
9.
\-
]
+
\.
[
a
-
z
]
{2,6}
>
\s
wrote:
`
gmiU
Open regex in editor
Description
Loading markdown...
Submitted by
anonymous
-
5 years ago
2018-10-16 18:44