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
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.
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
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
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
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
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
29
Wrap long string to spec length
Created
·
2013-07-21 20:34
Flavor
·
PCRE (Legacy)
no description available
Submitted by
fullpipe
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
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
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
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
15
IPv4
Created
·
2015-12-17 08:14
Flavor
·
PCRE (Legacy)
no description available
Submitted by
robwa
6
Matching balanced parens, brackets, and braces
Created
·
2013-09-29 18:23
Flavor
·
PCRE (Legacy)
no description available
Submitted by
Noah Luck Easterly
13
Match Gmail Email
Created
·
2014-11-20 23:58
Flavor
·
PCRE (Legacy)
Recommended
·
Match Gmail Email
Submitted by
Óscar EnrÃquez
6
json
Created
·
2014-08-14 17:30
Flavor
·
PCRE (Legacy)
{1:aa,2:bb,3:"aa:bb"}
Submitted by
suat & umut
11
Address Check Validation
Created
·
2014-01-30 13:56
Flavor
·
PCRE (Legacy)
Check for true or false street address format
Submitted by
Dilip Borad
0
utf-8 language
Created
·
2015-09-15 13:13
Flavor
·
PCRE (Legacy)
this regex is support for all languages
Submitted by
Jigar Dhaduk
12
Remove Special Ascii Characters from unicode String
Created
·
2015-03-12 11:00
Flavor
·
PCRE (Legacy)
By Using this string you can just remove ascii special characters from a unicode string characters like ♥♥♥♥ ▓▒ and other non unicode letters.
Submitted by
Hummad Hassan
8
Validate Base64 single-line string
Created
·
2013-05-31 00:35
Flavor
·
PCRE (Legacy)
no description available
Submitted by
ka.
1
IP Addresses
Created
·
2015-07-16 16:42
Flavor
·
PCRE (Legacy)
Matches IP Addresses with minimum false positives
Submitted by
Austin-Hanson
9
domain - host
Created
·
2015-09-29 17:50
Flavor
·
Python
no description available
Submitted by
anonymous
4
Element's Attribute Value in XML (simple)
Created
·
2014-06-24 11:29
Flavor
·
PCRE (Legacy)
Simple regular expression for extracting attribute value of the element in XML-string. Attribute value should be in quotes.
Submitted by
Nikita Danilov
7
CSS Import
Created
·
2014-05-03 00:51
Flavor
·
Python
no description available
Submitted by
anonymous
15
RFC3339 DateTime
Created
·
2016-02-12 11:44
Flavor
·
PCRE (Legacy)
Recommended
·
Validates a RFC3339 DateTime format. Does not validates the Data
Submitted by
anonymous
5
Separate words (works with spaces, dashes and underscores)
Created
·
2014-10-07 17:30
Flavor
·
PCRE (Legacy)
no description available
Submitted by
marcoslhc
4
Remove HTML tags
Created
·
2014-10-01 08:36
Flavor
·
PCRE (Legacy)
This regex is used to remove HTML tag on string
Submitted by
Jordane BACHELET
6
Username:Password
Created
·
2015-07-12 06:50
Flavor
·
PCRE (Legacy)
Regex For finding username:password
Submitted by
Ghost
10
Strip Email ID from Name
Created
·
2014-11-24 22:41
Flavor
·
PCRE (Legacy)
Use this regex to select all characters up to the "" bracket. It works across multiple lines. You can get an email list with only the IDs. This is the pattern it matches: Alpha Person Step 1 (.*) $ Step 2 [$.$ gives you aperson@whatever.org
Submitted by
Jonathan Davidar
Community Library Entry
0
Regular Expression
Created
·
2023-06-09 06:36
Flavor
·
.NET 7.0 (C#)
@"
^
(?=
(?<http>
(?:
https
?
:
\/\/
){1}(?:
www
\.
)?
)?
)(?
(?=
\k<http>
?
(?<ipaddr>
(?:
\d
{1,3}
\.
){3}
\d
{1,3}
(?:
\:
\d
{1,5}
)?
)
)
\k<http>
?
\k<ipaddr>
(?:
\.
[
\w
]
{1,9}
)?
|
\k<http>
(?:
[
\w
]
\.
?
){1,255}
\.
[
\w
]
{1,9}
)(?:
\/
.
*
)?
$
"
gm
Open regex in editor
Description
Can be used to validate on URL's.
Submitted by
anonymous