Please enable JavaScript to use this web application.
Regular
Expressions
101
Social
Donate
Info
Regex Editor
Community Patterns
Account
Regex Quiz
Settings
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 7.0 (C#)
Rust
Sponsors
There are currently no sponsors.
Become a sponsor today!
Community Patterns
Search among 11,900 community submitted regex patterns...
0
Sparkpost email address local part
PCRE2 (PHP >=7.3)
Tests if string can be used as a valid sparkpost sending email address
Submitted by
MreeP
-
2 years ago
(Last modified 2 years ago)
0
Release and master branches
PCRE2 (PHP >=7.3)
refs/heads/release/1.0.1 refs/heads/master master release/1.0.1
Submitted by
AbdElraouf Sabri
-
2 years ago
(Last modified 2 years ago)
0
Grab CalVer from git tags
PCRE2 (PHP >=7.3)
When using git ls-remote --tags --sort=version:refname, the results display the git hash as well as a refs prefix. This regex grabs only the CalVer string.
Submitted by
John Obla
-
2 years ago
0
sdsds@needemand.com
PCRE2 (PHP >=7.3)
sdsds@needemand.com
Submitted by
anonymous
-
2 years ago
0
passw125
PCRE2 (PHP >=7.3)
^(?=.\d)(?=.\W)(?=.*[a-zA-Z]).{6,8}$
Submitted by
AS
-
2 years ago
0
regex html tag
PCRE2 (PHP >=7.3)
$subject = 'asdasdsdsa'; $pattern = '^(.+)?';
Submitted by
anonymous
-
2 years ago
0
Date FR
PCRE2 (PHP >=7.3)
Date FR
Submitted by
anonymous
-
2 years ago
(Last modified a year ago)
0
Date EN
PCRE2 (PHP >=7.3)
Date EN
Submitted by
anonymous
-
2 years ago
(Last modified a year ago)
0
Myliberary
PCRE2 (PHP >=7.3)
Page to be the first place of African and the horns and knowledge of the first place of ethiopia What time mashilla first place on mobile devices At one
Submitted by
anonymous
-
2 years ago
0
Initial Ceros and Grouping Characters
PCRE2 (PHP >=7.3)
remove what title says
Submitted by
anonymous
-
2 years ago
0
Regex EKS Logs
PCRE2 (PHP >=7.3)
This Just For Test
Submitted by
JuniYadi
-
2 years ago
0
BSDS regex example 1
PCRE2 (PHP >=7.3)
Part of a training course
Submitted by
Coppelia
-
2 years ago
0
Remove domains in email addresses after @
PCRE2 (PHP >=7.3)
Remove domains in email addresses after @
Submitted by
anonymous
-
2 years ago
0
JavaScript Array
PCRE2 (PHP >=7.3)
Matches items in a JavaScript Array
Submitted by
me
-
2 years ago
0
Word Match
PCRE2 (PHP >=7.3)
Matches Word
Submitted by
cool66
-
2 years ago
0
Word
PCRE2 (PHP >=7.3)
match words
Submitted by
e
-
2 years ago
0
HTML Tag Matcher
PCRE2 (PHP >=7.3)
Matches html tags [new update]
Submitted by
cool66
-
2 years ago
0
Match Email
PCRE2 (PHP >=7.3)
Matches email.
Submitted by
cool66
-
2 years ago
0
goodreads published year dump
PCRE2 (PHP >=7.3)
this can be use to dump you book info
Submitted by
Sjoerd
-
2 years ago
0
Prime NG upgrade
PCRE2 (PHP >=7.3)
Prime NG grid upgrade from 9 to 14
Submitted by
anonymous
-
2 years ago
1
...
563
564
565
566
567
...
595
Parsing browser User Agents
27
Regular Expression
PCRE (PHP <7.3)
/
(?(DEFINE)
(?P<ver>
\d
+
(?:
\.
\d
+
)*
(?!
[
.
\d
]
)
)
(?P<agent>
Mozilla
\/
(?&ver)
)
(?P<os>
(?&os_windows)
|
(?&os_linux)
|
(?&os_macintosh)
|
(?&os_ios)
)
(?P<os_windows>
Windows
[
]
\w
+
[
]
(?&ver)
)
(?P<os_linux>
Linux
(?:
[
]
(?:
i686
|
x86_64
)
)?
)
(?P<os_macintosh>
Macintosh
)
(?P<os_ios>
(?:
CPU
[
]
)?
iPhone
[
]
OS
|
CPU
[
]
OS
.
*
?
like
[
]
Mac
[
]
OS
[
]
X
)
(?P<device>
(?&device_ios)
|
(?&device_firefox)
|
(?&device_android)
)
(?P<device_ios>
iPhone
|
iPad
)
(?P<device_firefox>
Mobile
)
(?P<device_android>
Android
(?:
[
]
(?&ver)
)?
)
(?P<browser>
(?:
(?&browser_ie)
|
(?&browser_safari)
|
(?&browser_chrome)
|
(?&browser_chromium)
|
(?&browser_firefox)
|
(?&browser_version)
#
|
(?&browser_nexus)
|
(?&browser_mobile)
|
(?&browser_gsa)
|
(?&browser_quicklook)
|
(?&browser_opera)
)
[
\/
]
(?:
[
A
-
Z
\d
]
+
\b
(?!
\.
)
|
(?&ver)
)
)
(?P<browser_safari>
(?:
Mobile
[
]
)?
Safari
)
(?P<browser_chrome>
Chrome
)
(?P<browser_chromium>
\b\w
+
\b
[
]
Chromium
)
(?P<browser_firefox>
Firefox
)
(?P<browser_ie>
MSIE
)
(?P<browser_version>
Version
)
(?P<browser_nexus>
Nexus
[
]
\d
+
[
]
Build
)
(?P<browser_mobile>
Mobile
)
(?P<browser_gsa>
GSA
)
(?P<browser_quicklook>
QuickLook
)
(?P<browser_opera>
OPR
)
)
^
(?:
(?=
.
*
?
(?P<Agent>
(?&agent)
)
)
)
(?:
(?=
.
*
?
(?P<OS>
(?&os)
)
)
)
(?:
(?=
.
*
?
(?P<Device>
(?&device)
)
)
)?
(?:
(?=
.
*
?
(?P<Browser>
(?&browser)
(?:
[
]
(?&browser)
)*
)
)
)?
/
gmx
Open regex in editor
Description
From a (fairly large) list of User Agent strings, extract the OS, Browser, and Device Type.
Submitted by
OnlineCop
-
10 years ago
(Last modified a year ago)