Please enable JavaScript to use regex101
Regular
Expressions
101
Support Regex101
Social
Info
Regex Editor
Community Library
Account
Regex Quiz
Order By
Most Recent
Most upvotes
Most downvotes
Highest Score
Lowest Score
Filter by Flavor
PCRE2 (PHP)
JavaScript
Python
Golang
Java
.NET 7.0 (C#)
Rust
POSIX ERE
POSIX BRE (grep/sed)
PCRE (Legacy)
Sponsors
digidib · when security, quality, and reliability matter
Community Library
Search community submissions...
0/512
485
regex101.com permalink id grabber
Created
·
2013-12-12 13:09
Updated
·
2024-04-11 14:32
Type
·
Match
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
107
ECMAScript/JavaScript trim
Created
·
2013-09-10 08:21
Updated
·
2024-09-19 14:38
Type
·
Match
Flavor
·
JavaScript
Trim leading and trailing whitespace from a string.
Submitted by
fp
238
Matching email addresses per RFC5322
Created
·
2013-10-23 17:46
Type
·
Match
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
73
Regex for telephone numbers all over the world
Created
·
2014-04-08 07:58
Updated
·
2023-10-09 14:47
Type
·
Match
Flavor
·
JavaScript
Recommended
·
Detects most of the phone numbers all over the world
Submitted by
Aditya Joshi
19
Date: DD-MM-YYYY hh:mm:ss
Created
·
2013-05-17 13:07
Type
·
Match
Flavor
·
PCRE (Legacy)
Recommended
·
Validate and capture dateTime parts, includes validation for leap years, range 1000-2999. Fixed bug
Submitted by
Ka.
41
URL regexp
Created
·
2013-01-14 17:52
Type
·
Match
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
87
Password Validation
Created
·
2015-07-08 18:46
Type
·
Match
Flavor
·
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
Type
·
Match
Flavor
·
PCRE (Legacy)
no description available
Submitted by
Mitus M.
6
Password
Created
·
2013-12-06 14:02
Updated
·
2023-07-21 04:59
Type
·
Match
Flavor
·
JavaScript
no description available
Submitted by
Anonymous
53
Disorted Email Addresses
Created
·
2013-01-16 14:11
Type
·
Substitution
Flavor
·
PCRE (Legacy)
Matches distorted email addresses and converts them back to real ones.
Submitted by
dislick
31
Email address (most used)
Created
·
2015-07-01 09:32
Type
·
Match
Flavor
·
JavaScript
Email address, most used cases
Submitted by
Jago
18
Email validation
Created
·
2014-09-16 13:45
Type
·
Match
Flavor
·
PCRE (Legacy)
no description available
Submitted by
tutsplus.com
83
Distinguish torrent files (series vs movies)
Created
·
2014-06-26 09:59
Updated
·
2023-07-20 15:08
Type
·
Match
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
4
Phone number
Created
·
2015-06-23 19:15
Type
·
Match
Flavor
·
PCRE (Legacy)
no description available
Submitted by
Mark Landry
36
Google like regex
Created
·
2014-05-12 13:35
Type
·
Match
Flavor
·
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
16
Alphanumeric Regex
Created
·
2015-06-15 13:57
Type
·
Match
Flavor
·
PCRE (Legacy)
no description available
Submitted by
Deepan
14
Phone Number
Created
·
2015-08-11 17:07
Type
·
Match
Flavor
·
JavaScript
Allows phone numbers with optional country code, optional special characters and whitespace
Submitted by
Tlmader
16
Password
Created
·
2015-04-28 16:49
Type
·
Match
Flavor
·
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
Type
·
Match
Flavor
·
PCRE (Legacy)
1-15 alphanumeric login name
Submitted by
gsanchezc
26
match valid JSON
Created
·
2014-11-17 20:47
Type
·
Match
Flavor
·
PCRE (Legacy)
Matches any valid JSON object, matches recursively. Passes all JSON test cases I found.
Submitted by
Mateon1
13
URL Validator
Created
·
2014-09-24 08:41
Type
·
Match
Flavor
·
PCRE (Legacy)
Validates - URLs with schemes - http, https and ftp Relative URL starting with / and ../
Submitted by
Anonymous
3
Match quoted strings, ignoring escaped quotes
Created
·
2013-06-26 14:28
Type
·
Match
Flavor
·
PCRE (Legacy)
Matches single or double quoted strings, and ignores backslash-escaped quotes within the string.
Submitted by
Maddingue
16
http url regex
Created
·
2015-06-21 19:49
Type
·
Match
Flavor
·
JavaScript
general purpose HTTP URL regex
Submitted by
Miguel Castillo @manchagnu
9
Youtube ID match
Created
·
2013-11-28 13:30
Type
·
Match
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
29
CSV line parsing
Created
·
2014-10-15 13:22
Type
·
Match
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
Type
·
Match
Flavor
·
PCRE (Legacy)
no description available
Submitted by
peek
25
Quote Macthing with escape
Created
·
2015-05-10 20:48
Type
·
Match
Flavor
·
JavaScript
Matches text within quotes (", ') and escapes the charecters.
Submitted by
Vihan Bhargava
0
URL matching
Created
·
2014-07-02 06:34
Type
·
Match
Flavor
·
PCRE (Legacy)
Complete url matching with storage of various parameters
Submitted by
hjpotter92
29
Wrap long string to spec length
Created
·
2013-07-21 20:34
Type
·
Substitution
Flavor
·
PCRE (Legacy)
no description available
Submitted by
fullpipe
13
regex101.com id grabber
Created
·
2014-08-19 16:10
Type
·
Match
Flavor
·
PCRE (Legacy)
grabs the ID for the regex101.com permalink to code
Submitted by
chris mccoy
7
Date validation
Created
·
2015-07-24 11:21
Type
·
Match
Flavor
·
JavaScript
Besides leap year handling, this takes care of date validation in the yy-mm-dd format.
Submitted by
Anonymous
22
UK Postcode Checker
Created
·
2014-10-21 08:23
Type
·
Match
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
1
Validate alphanumeric and numeric range
Created
·
2014-09-22 09:13
Type
·
Match
Flavor
·
PCRE (Legacy)
For Validating alphanumeric and numeric range
Submitted by
Anonymous
11
Date(Including Leap Year) YYYY-MM-DD hh:mm:ss
Created
·
2014-03-14 16:49
Type
·
Match
Flavor
·
PCRE (Legacy)
Validates DateTime of format YYYY-MM-DD hh:mm:ss including Leap Year
Submitted by
Madhan
3
phone
Created
·
2015-05-07 17:14
Type
·
Match
Flavor
·
Python
matches: + example: +52 33 3884 7720 +1 770 343 5788
Submitted by
miqui
9
only numbers
Created
·
2015-11-26 16:19
Type
·
Match
Flavor
·
PCRE (Legacy)
A string with only numbers in
Submitted by
Gotts
-18
dd-mm-YYYY HH:mm:ss (year range 1000-2999)
Created
·
2013-05-13 22:48
Updated
·
2023-07-24 16:28
Type
·
Match
Flavor
·
PCRE (Legacy)
Validate Gregorian calendar dates that contain 24-hour times. This will also correctly match the Feb 29 date when it falls on a valid leap year. Leap years occur every 4 years, with one exception: when a year is evenly divisible by 100 but not evenly divisible by 400, the year will not be a leap year. Thus years 2100, 2200, and 2300 are not leap years but years 2000, 2400, and 2800 are.
Submitted by
Ka.
0
utf-8 language
Created
·
2015-09-15 13:13
Type
·
Match
Flavor
·
PCRE (Legacy)
this regex is support for all languages
Submitted by
Jigar Dhaduk
9
Extract Protocol, URL, URL Path, get parameters and hash from URI
Created
·
2014-05-22 23:34
Type
·
Match
Flavor
·
Python
This is simplified from my last submission.
Submitted by
Dale O'Brien
4
url
Created
·
2015-07-23 21:43
Type
·
Unit Tests
Flavor
·
JavaScript
no description available
Submitted by
Anonymous
6
Matching balanced parens, brackets, and braces
Created
·
2013-09-29 18:23
Type
·
Match
Flavor
·
PCRE (Legacy)
no description available
Submitted by
Noah Luck Easterly
13
PHP variable name
Created
·
2013-02-05 09:18
Type
·
Match
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
6
Simple Number
Created
·
2015-10-20 16:06
Type
·
Match
Flavor
·
JavaScript
Verifies Number is a negative/positive number. Number may be a decimal, but if it is, it requires at least one number before and after the decimal place. Decimal numbers may also be negative or positive. Only 1 decimal place is allowed.
Submitted by
David P Smith
1
IP Addresses
Created
·
2015-07-16 16:42
Type
·
Match
Flavor
·
PCRE (Legacy)
Matches IP Addresses with minimum false positives
Submitted by
Austin-Hanson
0
Name
Created
·
2015-06-04 14:55
Type
·
Match
Flavor
·
JavaScript
Simple name matching Matches english names only, you may add international characters to list of characters.
Submitted by
Ehsan
12
Full name (Turkish)
Created
·
2014-09-29 13:31
Type
·
Match
Flavor
·
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
6
json
Created
·
2014-08-14 17:30
Type
·
Match
Flavor
·
PCRE (Legacy)
{1:aa,2:bb,3:"aa:bb"}
Submitted by
suat & umut
20
Between tags content
Created
·
2015-10-24 10:52
Type
·
Match
Flavor
·
PCRE (Legacy)
no description available
Submitted by
Agustín Bouillet
4
Element's Attribute Value in XML (simple)
Created
·
2014-06-24 11:29
Type
·
Substitution
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
Match text (not within html tag)
Created
·
2015-05-12 12:38
Type
·
Substitution
Flavor
·
JavaScript
no description available
Submitted by
Moistly
Load More
Community Library Entry
2
Regular Expression
Open Workspace
`
^
(?:
#
(?:
(
[
\d
a
-
f
][
\d
a
-
f
]
)(
[
\d
a
-
f
][
\d
a
-
f
]
)(
[
\d
a
-
f
][
\d
a
-
f
]
)
|
(
[
\d
a
-
f
]
)(
[
\d
a
-
f
]
)(
[
\d
a
-
f
]
)
)
|
\(
?
(
\d
|
1
?
\d
{2}
|
2
[
0
-
5
]
{2}
)
\s
*
,
\s
*
(
\d
|
1
?
\d
{2}
|
2
[
0
-
5
]
{2}
)
\s
*
,
\s
*
(
\d
|
1
?
\d
{2}
|
2
[
0
-
5
]
{2}
)(?:
\s
*
,
\s
*
(?:
\d
|
1
?
\d
{2}
|
2
[
0
-
5
]
{2}
)
)?
\)
?
)
$
`
ig
Description
Created
·
2026-02-03 03:22
Updated
·
2026-02-04 03:36
Type
·
Match
Flavor
·
Golang
match: #aabbcc #abc (255,255,255) (255,255,255,255) 255,255,255 no match: #gggggg #ggg 256,256,256
Submitted by
Doyoung
Open Workspace