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
Most upvotes
Most downvotes
Highest Score
Lowest Score
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 18,040 community submitted regex patterns...
1
test
PCRE (PHP <7.3)
test
Submitted by
test
-
10 years ago
1
url
ECMAScript (JavaScript)
no description available
Submitted by
anonymous
-
10 years ago
1
Get value from string
ECMAScript (JavaScript)
Used to get a value from a class e.g.: [...] class="font-12"[...] This regEx will receive "12" given the content of the class
Submitted by
Gabriel R. Sezefredo
-
10 years ago
1
German ZIP Validation
ECMAScript (JavaScript)
Validates German ZIP codes
Submitted by
wehmoen
-
10 years ago
1
Timecode
Python
Regex to match standard timecode format.
Submitted by
Travis
-
10 years ago
1
Digit
ECMAScript (JavaScript)
no description available
Submitted by
anonymous
-
10 years ago
1
End of line - SJava
ECMAScript (JavaScript)
no description available
Submitted by
anonymous
-
10 years ago
1
Test BigDecimal formatter
ECMAScript (JavaScript)
no description available
Submitted by
Wally
-
9 years ago
1
CSV parsing
PCRE (PHP <7.3)
matches the exact fields of CSV files supports: qouted fields quoted fields containing commas, doubble quoutes, and newlines empty fields empty records arbitrary white space in, and outside quoted fields
Submitted by
Austin
-
9 years ago
1
Apache Access Log pattern
Python
Apache Web server log file format following the standard
Submitted by
Basil Tungekar
-
9 years ago
1
Error Regex
PCRE (PHP <7.3)
no description available
Submitted by
anonymous
-
9 years ago
1
Address email
ECMAScript (JavaScript)
no description available
Submitted by
JS
-
9 years ago
1
a-zA-Z + 0-9 + [!$%&?]
PCRE (PHP <7.3)
no description available
Submitted by
anonymous
-
9 years ago
1
Name Validation
PCRE (PHP <7.3)
Start with capital letter. Allowed special characters '(Apostrophe) -(hyphen) .(dot) (space) and can not end with -(Hyphen)
Submitted by
Venu Nimmagadda
-
9 years ago
1
C-Syle If Statement to Excel
ECMAScript (JavaScript)
no description available
Submitted by
nomloc
-
9 years ago
1
dutch zipcode with named matching
PCRE (PHP <7.3)
no description available
Submitted by
Eelke van den Bos
-
9 years ago
1
Italian Fiscal Code [Codice fiscale]
ECMAScript (JavaScript)
Codice fiscale italiano
Submitted by
Italo
-
9 years ago
1
ipv4 IP addressses, capturing private ranges
PCRE (PHP <7.3)
Capture 0.0.0.0-255.255.255.255 IP address octets. Capture private ranges, such as '169.254.' and '10.'
Submitted by
OnlineCop
-
9 years ago
1
decimal number validation
PCRE (PHP <7.3)
accepts 1; 1.1; 112315.23135
Submitted by
MS
-
9 years ago
1
username
PCRE (PHP <7.3)
Letras, Ñ, acentos, números, guión y barra baja
Submitted by
diegosanz
-
9 years ago
1
...
838
839
840
841
842
...
902
Community Library Entry
1
Regular Expression
PCRE (PHP <7.3)
/
(
\[
(?:
[^
[
\]
]
*
?
)
\]
\s
*
?
(?=
\[
)
)
|
(
\[
(?:
[^
[
\]
]
*
?
)
\]
(?!
\s
*
[
\|
&
]
\s
*
.
)
)
|
(?:
\[
[^
[
\]
]
*
?
]
)
|
(
[^
&
\|
\s
]
+
)
\s
+
(?=
[^
&
\|
\s
]
+
)
/
g
Open regex in editor
Description
/**
this regex should match most cases where the user forgets to put an operator somewhere and add an OR, it still
does not handle nested square brackets but those are invalid anyways
this page has an explanation
https://regex101.com/r/fF7wO1/2
the way this regex grabs conflicting matches is by oring different cases together in the order we want to grab them in
the first case is for a set of brackets immediately followed by an opening bracket (seperate them with an or)
the second case is for a set of brackets immediately followed by any non operator character (seperate with an or)
the third case is for a set of brackets followed by an operator (do nothing)
the final case is for two words outside of brackets seperated by a space (fill space with an or)
@type {RegExp} */
Submitted by
warnock
-
9 years ago