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 17,260 community submitted regex patterns...
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)
Equation matching (without equal)
Python
use this to get value of any side of an equation. You can combine this with https://regex101.com/r/fH5kJ1/1
Submitted by
Kerosene2000
-
8 years ago
2015-07-01 19:50
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)
import url image
Python
import url image
Submitted by
bartimeys
-
8 years ago
2015-12-18 08:44
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
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
find uncommented coffeescript console.logs
ECMAScript (JavaScript)
no description available
Submitted by
valiafetisov
-
8 years ago
2016-01-18 01:52
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Version Matcher
PCRE (PHP <7.3)
Matches version strings.
Submitted by
anmols
-
8 years ago
2016-01-25 18:44
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
extract domain with port
ECMAScript (JavaScript)
no description available
Submitted by
yooresh
-
8 years ago
2016-02-18 08:29
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
Function Declaration / Expression
ECMAScript (JavaScript)
matches both function declarations and expressions in javascript. ex. function name () {...} || function () {}
Submitted by
Ja Superior
-
8 years ago
2016-03-09 09:13
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
DNS hostname well-formedness validation
PCRE (PHP <7.3)
Validates that a DNS hostname is well-formed only. You will still need to check that the overall length of the hostname, including the implied trailing "." (if not present), does not exceed 255 bytes.
Submitted by
Jeff Walter
-
8 years ago
2016-03-10 19:44
4
4 upvotes, 0 downvotes (score 51%) (You must be signed in to vote)
MasterCard validate 2017
PCRE (PHP <7.3)
Match a MasterCard with new range for 2017: 51-55 and 2221-2720 @incarnated
Submitted by
John C
-
8 years ago
2016-03-22 03:14
1
2
3
4
5
6
7
8
...
863
async calls in foreach
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Regular Expression
PCRE2 (PHP >=7.3)
/
foreach
\(
(?<loop>
[
a
-
zA
-
Z0
-
9-.
_
\(\)
]
+
)
\n
{
(?<code1>
[
a
-
zA
-
Z0
-
9-.
_
\;
\n
(
\)
{}
]
+
)
await
(?<code2>
[
a
-
zA
-
Z0
-
9-.
_
\;
\n
(
\)
{}
]
+
)
}
/
gm
Open regex in editor
Description
Loading markdown...
Submitted by
mmateeva
-
4 months ago
2023-05-18 07:13