Please enable JavaScript to use regex101
Regular
Expressions
101
Support Regex101
Social
Info
Regex Editor
Community Patterns
Account
Regex Quiz
Settings
Order By
Most Recent
Most upvotes
Most downvotes
Highest Score
Lowest Score
Filter by Flavor
PCRE2 (PHP)
ECMAScript (JavaScript)
Python
Golang
Java
.NET 7.0 (C#)
Rust
PCRE (Legacy)
Sponsors
There are currently no sponsors.
Become a sponsor today!
Community Patterns
Search among community submitted regex patterns...
0/512
485
regex101.com permalink id grabber
Created
·
2013-12-12 13:09
Updated
·
2024-04-11 14:32
Flavor
·
PCRE (Legacy)
Grabs the ID for the regex101.com permalink code. If a revision number is provided, grab that as well.
Submitted by
chris mccoy
238
Matching email addresses per RFC5322
Created
·
2013-10-23 17:46
Flavor
·
PCRE (Legacy)
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
107
ECMAScript/JavaScript trim
Created
·
2013-09-10 08:21
Updated
·
2024-09-19 14:38
Flavor
·
ECMAScript (JavaScript)
Trim leading and trailing whitespace from a string.
Submitted by
fp
73
Regex for telephone numbers all over the world
Created
·
2014-04-08 07:58
Updated
·
2023-10-09 14:47
Flavor
·
ECMAScript (JavaScript)
Recommended
·
Detects most of the phone numbers all over the world
Submitted by
Aditya Joshi
41
URL regexp
Created
·
2013-01-14 17:52
Flavor
·
PCRE (Legacy)
A quite neat regular expression for URLs, e-mails..., I found on Matthew O'Riordan's blog.
Submitted by
Matthew O'Riordan
19
Date: DD-MM-YYYY hh:mm:ss
Created
·
2013-05-17 13:07
Flavor
·
PCRE (Legacy)
Recommended
·
Validate and capture dateTime parts, includes validation for leap years, range 1000-2999. Fixed bug
Submitted by
Ka.
87
Password Validation
Created
·
2015-07-08 18:46
Flavor
·
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
35
http://
Created
·
2014-03-26 06:44
Flavor
·
PCRE (Legacy)
no description available
Submitted by
Mitus M.
53
Disorted Email Addresses
Created
·
2013-01-16 14:11
Flavor
·
PCRE (Legacy)
Matches distorted email addresses and converts them back to real ones.
Submitted by
dislick
83
Distinguish torrent files (series vs movies)
Created
·
2014-06-26 09:59
Updated
·
2023-07-20 15:08
Flavor
·
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 previously matched.
Submitted by
Firas Dib
6
Password
Created
·
2013-12-06 14:02
Updated
·
2023-07-21 04:59
Flavor
·
ECMAScript (JavaScript)
no description available
Submitted by
anonymous
31
Email address (most used)
Created
·
2015-07-01 09:32
Flavor
·
ECMAScript (JavaScript)
Email address, most used cases
Submitted by
Jago
35
Google like regex
Created
·
2014-05-12 13:35
Flavor
·
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
18
Email validation
Created
·
2014-09-16 13:45
Flavor
·
PCRE (Legacy)
no description available
Submitted by
tutsplus.com
16
Alphanumeric Regex
Created
·
2015-06-15 13:57
Flavor
·
PCRE (Legacy)
no description available
Submitted by
Deepan
4
Phone number
Created
·
2015-06-23 19:15
Flavor
·
PCRE (Legacy)
no description available
Submitted by
Mark Landry
14
Phone Number
Created
·
2015-08-11 17:07
Flavor
·
ECMAScript (JavaScript)
Allows phone numbers with optional country code, optional special characters and whitespace
Submitted by
Tlmader
26
match valid JSON
Created
·
2014-11-17 20:47
Flavor
·
PCRE (Legacy)
Matches any valid JSON object, matches recursively. Passes all JSON test cases I found.
Submitted by
Mateon1
16
Password
Created
·
2015-04-28 16:49
Flavor
·
ECMAScript (JavaScript)
Safe Password that allow only with a number, a lowercase, a uppercase, and a special character
Submitted by
davidlondono
23
userName
Created
·
2015-06-06 08:00
Flavor
·
PCRE (Legacy)
1-15 alphanumeric login name
Submitted by
gsanchezc
29
CSV line parsing
Created
·
2014-10-15 13:22
Flavor
·
PCRE (Legacy)
Captures all fields from a CSV file's line. Can be customized with user-defined field separator and protecting character.
Submitted by
Various
35
IP Address validator
Created
·
2015-06-18 12:52
Flavor
·
ECMAScript (JavaScript)
Validates IPv4 IP Address
Submitted by
krzysp
31
ninite
Created
·
2015-09-29 11:28
Flavor
·
PCRE (Legacy)
no description available
Submitted by
peek
13
URL Validator
Created
·
2014-09-24 08:41
Flavor
·
PCRE (Legacy)
Validates - URLs with schemes - http, https and ftp Relative URL starting with / and ../
Submitted by
anonymous
16
http url regex
Created
·
2015-06-21 19:49
Flavor
·
ECMAScript (JavaScript)
general purpose HTTP URL regex
Submitted by
Miguel Castillo @manchagnu
29
Wrap long string to spec length
Created
·
2013-07-21 20:34
Flavor
·
PCRE (Legacy)
no description available
Submitted by
fullpipe
25
Quote Macthing with escape
Created
·
2015-05-10 20:48
Flavor
·
ECMAScript (JavaScript)
Matches text within quotes (", ') and escapes the charecters.
Submitted by
Vihan Bhargava
9
Youtube ID match
Created
·
2013-11-28 13:30
Flavor
·
PCRE (Legacy)
This regex will match any Youtube video ID thrown at it and return one capturing group containing the ID.
Submitted by
Jacob Overgaard
3
Match quoted strings, ignoring escaped quotes
Created
·
2013-06-26 14:28
Flavor
·
PCRE (Legacy)
Matches single or double quoted strings, and ignores backslash-escaped quotes within the string.
Submitted by
Maddingue
22
UK Postcode Checker
Created
·
2014-10-21 08:23
Flavor
·
PCRE (Legacy)
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 space and separates the two parts into groups.
Submitted by
MaffooBristol
13
regex101.com id grabber
Created
·
2014-08-19 16:10
Flavor
·
PCRE (Legacy)
grabs the ID for the regex101.com permalink to code
Submitted by
chris mccoy
36
Strict Password Validator
Created
·
2018-01-31 01:03
Updated
·
2023-07-19 15:28
Flavor
·
ECMAScript (JavaScript)
This regex matches only when all the following are true: password must contain 1 number (0-9) password must contain 1 uppercase letters password must contain 1 lowercase letters password must contain 1 non-alpha numeric number password is 8-16 characters with no space
Submitted by
qho
37
best youtube id match ( iframe embed replace ready )
Created
·
2019-03-12 16:17
Flavor
·
PCRE (Legacy)
Recommended
·
MATCH ANY YOUTUBE ID author : mi-ca v1.0 – 2017.03.08 This Regex match any youtube url and grab the ID. Embed ready √ -- `http://www.youtube.com/watch?v=vpiMAaPTze8 http://youtu.be/l_la5XiQJdk http://youtu.be/NLqAF9hrVbY https://youtu.be/qT47KF5pvfw https://youtu.be/zImHyTyYhM8?t=4s http://www.youtube.com/v/NLqAF9hrVbY?fs=1&hl=en_US http://www.youtube.com/v/NLqAF9hrVbY?fs=1&hl=en_US http://www.youtube.com/watch?v=NLqAF9hrVbY http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo http://www.youtube.com/ytscreeningroom?v=NRHVzbJVx8I http://www.youtube.com/sandalsResorts#p/c/54B8C800269D7C1B/2/PPS-8DMrAn4 http://gdata.youtube.com/feeds/api/videos/NLqAF9hrVbY http://www.youtube.com/watch?v=spDj54kf-vY&feature=g-vrec http://www.youtube.com/watch?v=spDj54kf-vY&feature=youtu.be http://www.youtube-nocookie.com/watch?v=NLqAF9hrVbY http://www.youtube.com/embed/NLqAF9hrVbY https://www.youtube.com/embed/NLqAF9hrVbY https://www.youtube.com/watch?v=MRl7cxSOXdU&feature=youtu.be https://www.youtube.com/watch?v=q07SQFmL4rM https://www.youtube.com/watch?v=q07SQFmL4yM https://www.youtube.com/watch?time_continue=4&v=zImHyTyYhM8 http://www.youtube.com/embed/dQw4w9WgXcQ ... http://www.youtube.com/watch?v=dQw4w9WgXcQ ... http://www.youtube.com/?v=dQw4w9WgXcQ ... http://www.youtube.com/v/dQw4w9WgXcQ ... http://www.youtube.com/e/dQw4w9WgXcQ ... http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ ... http://www.youtube.com/sandalsResorts#p/c/54B8C800269D7C1B/0/dQw4w9WgXcQ ... http://www.youtube.com/watch?feature=player_embedded&v=dQw4w9WgXcQ ... http://www.youtube.com/?feature=player_embedded&v=dQw4w9WgXcQ ... https://www.youtube.com/watch?v=DFYRQ_zQ-gk&feature=featured https://www.youtube.com/watch?v=DFYRQ_zQ-gk http://www.youtube.com/watch?v=DFYRQ_zQ-gk //www.youtube.com/watch?v=DFYRQ_zQ-gk www.youtube.com/watch?v=DFYRQ_zQ-gk https://youtube.com/watch?v=DFYRQ_zQ-gk http://youtube.com/watch?v=DFYRQ_zQ-gk //youtube.com/watch?v=DFYRQ_zQ-gk youtube.com/watch?v=DFYRQ_zQ-gk https://m.youtube.com/watch?v=DFYRQ_zQ-gk http://m.youtube.com/watch?v=DFYRQ_zQ-gk //m.youtube.com/watch?v=DFYRQ_zQ-gk m.youtube.com/watch?v=DFYRQ_zQ-gk https://www.youtube.com/v/DFYRQ_zQ-gk?fs=1&hl=en_US http://www.youtube.com/v/DFYRQ_zQ-gk?fs=1&hl=en_US //www.youtube.com/v/DFYRQ_zQ-gk?fs=1&hl=en_US www.youtube.com/v/DFYRQ_zQ-gk?fs=1&hl=en_US youtube.com/v/DFYRQ_zQ-gk?fs=1&hl=en_US https://www.youtube.com/embed/DFYRQ_zQ-gk?autoplay=1 https://www.youtube.com/embed/DFYRQ_zQ-gk http://www.youtube.com/embed/DFYRQ_zQ-gk //www.youtube.com/embed/DFYRQ_zQ-gk www.youtube.com/embed/DFYRQ_zQ-gk https://youtube.com/embed/DFYRQ_zQ-gk http://youtube.com/embed/DFYRQ_zQ-gk //youtube.com/embed/DFYRQ_zQ-gk youtube.com/embed/DFYRQ_zQ-gk https://youtu.be/DFYRQ_zQ-gk?t=120 https://youtu.be/DFYRQ_zQ-gk http://youtu.be/DFYRQ_zQ-gk //youtu.be/DFYRQ_zQ-gk youtu.be/DFYRQ_zQ-gk https://www.youtube.com/watch?v=DFYRQ_zQ-gk&feature=featured https://www.youtube.com/watch?v=DFYRQ_zQ-gk http://www.youtube.com/watch?v=DFYRQ_zQ-gk //www.youtube.com/watch?v=DFYRQ_zQ-gk www.youtube.com/watch?v=DFYRQ_zQ-gk https://youtube.com/watch?v=DFYRQ_zQ-gk http://youtube.com/watch?v=DFYRQ_zQ-gk //youtube.com/watch?v=DFYRQ_zQ-gk youtube.com/watch?v=DFYRQ_zQ-gk https://m.youtube.com/watch?v=DFYRQ_zQ-gk http://m.youtube.com/watch?v=DFYRQ_zQ-gk //m.youtube.com/watch?v=DFYRQ_zQ-gk m.youtube.com/watch?v=DFYRQ_zQ-gk https://www.youtube.com/v/DFYRQ_zQ-gk?fs=1&hl=en_US http://www.youtube.com/v/DFYRQ_zQ-gk?fs=1&hl=en_US //www.youtube.com/v/DFYRQ_zQ-gk?fs=1&hl=en_US www.youtube.com/v/DFYRQ_zQ-gk?fs=1&hl=en_US youtube.com/v/DFYRQ_zQ-gk?fs=1&hl=en_US https://www.youtube.com/embed/DFYRQ_zQ-gk?autoplay=1 https://www.youtube.com/embed/DFYRQ_zQ-gk http://www.youtube.com/embed/DFYRQ_zQ-gk //www.youtube.com/embed/DFYRQ_zQ-gk www.youtube.com/embed/DFYRQ_zQ-gk https://youtube.com/embed/DFYRQ_zQ-gk http://youtube.com/embed/DFYRQ_zQ-gk //youtube.com/embed/DFYRQ_zQ-gk youtube.com/embed/DFYRQ_zQ-gk https://youtu.be/DFYRQ_zQ-gk?t=120 https://youtu.be/DFYRQ_zQ-gk http://youtu.be/DFYRQ_zQ-gk //youtu.be/DFYRQ_zQ-gk youtu.be/DFYRQ_zQ-gk https://www.youtube.com/HamdiKickProduction?v=DFYRQ_zQ-gk `
Submitted by
mi-ca.ch
7
Date validation
Created
·
2015-07-24 11:21
Flavor
·
ECMAScript (JavaScript)
Besides leap year handling, this takes care of date validation in the yy-mm-dd format.
Submitted by
anonymous
37
Cron schedule
Created
·
2016-06-02 15:45
Flavor
·
PCRE (Legacy)
Recommended
·
Validate cron lines (even the ones commented out)
Submitted by
anonymous
11
Date(Including Leap Year) YYYY-MM-DD hh:mm:ss
Created
·
2014-03-14 16:49
Flavor
·
PCRE (Legacy)
Validates DateTime of format YYYY-MM-DD hh:mm:ss including Leap Year
Submitted by
Madhan
0
URL matching
Created
·
2014-07-02 06:34
Flavor
·
PCRE (Legacy)
Complete url matching with storage of various parameters
Submitted by
hjpotter92
20
Between tags content
Created
·
2015-10-24 10:52
Flavor
·
PCRE (Legacy)
no description available
Submitted by
Agustín Bouillet
24
grab valid css rules and properties
Created
·
2015-06-03 19:17
Flavor
·
ECMAScript (JavaScript)
no description available
Submitted by
Pavel Dominguez
1
Validate alphanumeric and numeric range
Created
·
2014-09-22 09:13
Flavor
·
PCRE (Legacy)
For Validating alphanumeric and numeric range
Submitted by
anonymous
32
Parsing browser User Agents
Created
·
2015-01-23 16:47
Updated
·
2023-07-19 08:36
Flavor
·
PCRE (Legacy)
From a (fairly large) list of User Agent strings, extract the OS, Browser, and Device Type.
Submitted by
OnlineCop
9
only numbers
Created
·
2015-11-26 16:19
Flavor
·
PCRE (Legacy)
A string with only numbers in
Submitted by
Gotts
13
PHP variable name
Created
·
2013-02-05 09:18
Flavor
·
PCRE (Legacy)
Valid PHP variable name as defined in the manual at http://php.net/manual/en/language.variables.basics.php
Submitted by
Erin Millard
3
phone
Created
·
2015-05-07 17:14
Flavor
·
Python
matches: + example: +52 33 3884 7720 +1 770 343 5788
Submitted by
miqui
9
Extract Protocol, URL, URL Path, get parameters and hash from URI
Created
·
2014-05-22 23:34
Flavor
·
Python
This is simplified from my last submission.
Submitted by
Dale O'Brien
18
Date Regex(DD/MM/yyyy)
Created
·
2015-08-26 06:25
Flavor
·
PCRE (Legacy)
no description available
Submitted by
alcaamado
17
Capture comma separated numbers
Created
·
2015-07-19 01:57
Flavor
·
PCRE (Legacy)
Capture comma separated numbers, no matter if there are spaces before or after the commas.
Submitted by
Fernando Nunes
22
Email (RFC2822)
Created
·
2015-07-01 09:31
Flavor
·
ECMAScript (JavaScript)
Recommended
·
Email address compliant with RFC2822
Submitted by
Jago
12
Full name (Turkish)
Created
·
2014-09-29 13:31
Flavor
·
ECMAScript (JavaScript)
Matches case insensitive first name, optional unlimited number of middle names and last name separated with space format. Replaced \w with explicit char range for Turkish support. (Äž accepted as first char not to over complex)
Submitted by
CKK
15
IPv4
Created
·
2015-12-17 08:14
Flavor
·
PCRE (Legacy)
no description available
Submitted by
robwa
Community Library Entry
1
Regular Expression
Created
·
2015-11-06 15:52
Flavor
·
PCRE (Legacy)
/
^
(
(
(
\d
{0,16}
)
\.
\d
{1,16}
)
|
(
[
0
-
9
]
{1}
)
|
(
[
1
-
9
]
{1}
\d
{0,15}
)
|
[
1
-
9
]
{1,3}
(
,
\d
{3}
){1,}
|
(
(
[
1
-
9
]
{0,3}
,
(
\d
{1,3}
)
)*(
\.
\d
{1,16}
)
)
|
(
[
1
-
9
]
{1,3}
,
\d
{3}
)
)
$
/
gm
Open regex in editor
Description
any int, any int with decimal any int with comma delimited any int with comma delimited and decimal
Submitted by
amaroyche