Regular
Expressions
101
Please wait while the app is loading...
Please enable JavaScript to use this web application.
Regular
Expressions
101
@regex101
Donate
Sponsor
Contact
Bug Reports & Feedback
Wiki
What's new?
What's new?
Loading content...
Close
Regex Editor
Regex Editor
Regex Library
Regex Library
Account
Account
Regex Quiz
Regex Quiz
Settings
Settings
Live Help
Live Help
Order By
Most Recent
Most Points
Fewest Points
Filter by Flavor
PCRE2
PCRE
ECMAScript
Python
Golang
Java
.NET
Sponsors
All your environment variables, in one place
Library entries
Search library
483
1566 upvotes, 1083 downvotes (59% like it) (You must be signed in to vote)
pcre
regex101.com id grabber
grabs the ID for the regex101.com permalink to code
Submitted by
chris mccoy
-
9 years ago
234
715 upvotes, 481 downvotes (60% like it) (You must be signed in to vote)
pcre
Matching email addresses per RFC5322
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
-
10 years ago
106
600 upvotes, 494 downvotes (55% like it) (You must be signed in to vote)
javascript
trim
trim string
Submitted by
fp
-
10 years ago
84
295 upvotes, 211 downvotes (58% like it) (You must be signed in to vote)
javascript
Password Validation
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
-
8 years ago
71
409 upvotes, 338 downvotes (55% like it) (You must be signed in to vote)
javascript
Regex for telephone numbers all over the world
Detects most of the phone numbers all over the world
Submitted by
Aditya Joshi
-
9 years ago
51
191 upvotes, 140 downvotes (58% like it) (You must be signed in to vote)
pcre
Disorted Email Addresses
Matches distorted email addresses and converts them back to real ones.
Submitted by
dislick
-
10 years ago
40
325 upvotes, 285 downvotes (53% like it) (You must be signed in to vote)
pcre
URL regexp
A quite neat regular expression for URLs, e-mails..., I found on Matthew O'Riordan's blog.
Submitted by
Matthew O'Riordan
-
10 years ago
37
236 upvotes, 199 downvotes (54% like it) (You must be signed in to vote)
pcre
http://
no description available
Submitted by
Mitus M.
-
9 years ago
35
76 upvotes, 41 downvotes (65% like it) (You must be signed in to vote)
javascript
IP Address validator
Validates IPv4 IP Address
Submitted by
krzysp
-
8 years ago
34
123 upvotes, 89 downvotes (58% like it) (You must be signed in to vote)
javascript
Google like regex
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
32
78 upvotes, 46 downvotes (63% like it) (You must be signed in to vote)
pcre
ninite
no description available
Submitted by
peek
-
8 years ago
31
142 upvotes, 111 downvotes (56% like it) (You must be signed in to vote)
javascript
Email address (most used)
Email address, most used cases
Submitted by
Jago
-
8 years ago
28
69 upvotes, 41 downvotes (63% like it) (You must be signed in to vote)
pcre
Wrap long string to spec length
no description available
Submitted by
fullpipe
-
10 years ago
28
77 upvotes, 49 downvotes (61% like it) (You must be signed in to vote)
pcre
CSV line parsing
Captures all fields from a CSV file's line. Can be customized with user-defined field separator and protecting character.
Submitted by
Various
-
9 years ago
26
91 upvotes, 65 downvotes (58% like it) (You must be signed in to vote)
pcre
match valid JSON
Matches any valid JSON object, matches recursively. Passes all JSON test cases I found.
Submitted by
Mateon1
-
9 years ago
24
67 upvotes, 43 downvotes (61% like it) (You must be signed in to vote)
javascript
Quote Macthing with escape
Matches text within quotes (", ') and escapes the charecters.
Submitted by
Vihan Bhargava
-
8 years ago
23
35 upvotes, 12 downvotes (74% like it) (You must be signed in to vote)
javascript
grab valid css rules and properties
no description available
Submitted by
Pavel Dominguez
-
8 years ago
23
88 upvotes, 65 downvotes (58% like it) (You must be signed in to vote)
pcre
userName
1-15 alphanumeric login name
Submitted by
gsanchezc
-
8 years ago
22
59 upvotes, 37 downvotes (61% like it) (You must be signed in to vote)
pcre
UK Postcode Checker
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
18
21 upvotes, 3 downvotes (88% like it) (You must be signed in to vote)
pcre
Parsing browser User Agents
From a (fairly large) list of User Agent strings, extract the OS, Browser, and Device Type.
Submitted by
OnlineCop
-
8 years ago
1
2
3
4
...
731
UK Postcode Checker
Vote
22
59 upvotes, 37 downvotes (61% like it) (You must be signed in to vote)
Regular Expression
pcre
/
^
(
[
a
-
zA
-
Z
]
{1,2}
\d
{1,2}
)
\s
*
?
(
\d
[
a
-
zA
-
Z
]
{2}
)
$
/
gmi
Open regex in editor
Description
Loading markdown...
Submitted by
MaffooBristol
- 9 years ago