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 12,860 community submitted regex patterns...
18
310 upvotes, 292 downvotes (score 52.3%) (You must be signed in to vote)
Date: DD-MM-YYYY hh:mm:ss
Recommended
This entry has been specifically selected by our team to be a great submission
PCRE (PHP <7.3)
Validate and capture dateTime parts, includes validation for leap years, range 1000-2999. Fixed bug
Submitted by
Ka.
-
10 years ago
2013-05-17 13:07
107
601 upvotes, 494 downvotes (score 51.9%) (You must be signed in to vote)
trim
ECMAScript (JavaScript)
trim string
Submitted by
fp
-
10 years ago
2013-09-10 08:21
24
67 upvotes, 43 downvotes (score 51.6%) (You must be signed in to vote)
Quote Macthing with escape
ECMAScript (JavaScript)
Matches text within quotes (", ') and escapes the charecters.
Submitted by
Vihan Bhargava
-
8 years ago
2015-05-10 20:48
11
19 upvotes, 8 downvotes (score 51.5%) (You must be signed in to vote)
html color match: transparent, #fff, #123456, rgb, rgba, hsl, hsla
ECMAScript (JavaScript)
This may be useful or not to test whether a given string is a valid (more or less) html color value. It matches color values such as: #123 - short hex color value #123456 - hex color value rgb(255,255,0) - rgb color value rgba(255,255,0,1.0) - rgba color value hsl(360,100%,100%) - hsl color value...
Submitted by
grouch
-
9 years ago
2014-12-17 13:00
22
59 upvotes, 37 downvotes (score 51.5%) (You must be signed in to vote)
UK Postcode Checker
PCRE (PHP <7.3)
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 spac...
Submitted by
MaffooBristol
-
9 years ago
2014-10-21 08:23
34
123 upvotes, 89 downvotes (score 51.3%) (You must be signed in to vote)
Google like regex
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
-
9 years ago
2014-05-12 13:35
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
For Auto RTFs
PCRE (PHP <7.3)
no description available
Submitted by
Dan Bloomquist
-
11 years ago
2013-03-22 03:32
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
outer Parentheses
PCRE (PHP <7.3)
Finds the outermost pair of parentheses. Compatible with any amount of nesting
Submitted by
Jonas Gerneth
-
9 years ago
2014-04-25 11:43
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Command handling
PCRE (PHP <7.3)
Handles commands like in CMD
Submitted by
anonymous
-
9 years ago
2014-09-07 07:03
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
parsing a numeric strings with backslash using regexp
PCRE (PHP <7.3)
no description available
Submitted by
A.K. Asik
-
9 years ago
2014-11-13 17:42
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
uri parser
PCRE (PHP <7.3)
no description available
Submitted by
anonymous
-
9 years ago
2015-03-25 13:20
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Match nth occurence of pattern
PCRE (PHP <7.3)
Match nth occurence of the patterns in the inner parenthesis. Put nth that you want to match in the curly braces (here, {3}).
Submitted by
Alex Hall
-
8 years ago
2015-05-01 17:34
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Epic EHR Sticker QR code patient information
PCRE (PHP <7.3)
Text output produced by reading the QR code present on patient stickers created by Epic (R) medical record software
Submitted by
MeWa
-
8 years ago
2015-07-28 06:54
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)
Typescript - /// <reference path="..."/> Expression
ECMAScript (JavaScript)
Finds Typescript's reference path syntax.
Submitted by
Lovelidge, Shawn
-
8 years ago
2015-09-08 22:26
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)
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
1
2
3
4
5
6
7
...
643
Regex for telephone numbers all over the world
72
410 upvotes, 338 downvotes (score 51.2%) (You must be signed in to vote)
Regular Expression
Recommended
This entry has been specifically selected by our team to be a great submission
ECMAScript (JavaScript)
/
\+
?
\d
{1,4}
?
[
-.
\s
]
?
\(
?
\d
{1,3}
?
\)
?
[
-.
\s
]
?
\d
{1,4}
[
-.
\s
]
?
\d
{1,4}
[
-.
\s
]
?
\d
{1,9}
/
g
Open regex in editor
Description
Loading markdown...
Submitted by
Aditya Joshi
-
9 years ago
2014-04-08 07:58