Regular
Expressions
101
@regex101
Follow me on twitter!
Donate
Like regex101? Support it by donating!
Sponsor
Become a sponsor!
Contact
Send me an email
Bug Reports & Feedback
Bugs or suggestions go here
Wiki
Wiki (Info & FAQ)
Whats new?
Whats new?
Regex Editor
Regex Editor
Regex Library
Regex Library
Account
Account
Regex Quiz
Regex Quiz
Settings
Settings
Live Help
Live Help
Consider a donation
Consider a donation
Become a sponsor
Become a sponsor
Order By
Most Recent
Most Points
Fewest Points
Filter by Flavor
PCRE2 (PHP >= 7.3)
PCRE (PHP <7.3)
ECMAScript (JavaScript)
Python
Golang
Sponsor
Jamstack at Scale
Library entries
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre2
Submitted by
anonymous
-
5 hours ago
Dup words
no description available
1
1 upvotes, 0 downvotes (100% like it) (You must be signed in to vote)
pcre2
Submitted by
anonymous
-
5 hours ago
Dutch zipcodes
no description available
1
1 upvotes, 0 downvotes (100% like it) (You must be signed in to vote)
pcre2
Submitted by
anonymous
-
5 hours ago
Dutch mobile phone number
no description available
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre
Submitted by
anonymous
-
7 hours ago
Url regex
no description available
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre
Submitted by
anonymous
-
8 hours ago
aaa
no description available
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre
Submitted by
anonymous
-
13 hours ago
ATNALogSIEMUseCasesPurposeOfUseESClocal
Nur PurposeOfUse aus ATNA Log auswerten, in Kombination mit ATNALogSIEMUseCaseESC
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre2
Submitted by
anonymous
-
14 hours ago
Aplayer Icons Regex
no description available
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre2
Submitted by
anonymous
-
14 hours ago
cisco command
no description available
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre2
Submitted by
Habibi Mustafa
-
16 hours ago
Minify HTML
Remove Whitespace Remove Comment
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre2
Submitted by
anonymous
-
18 hours ago
get main content if has :
no description available
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre2
Submitted by
anonymous
-
18 hours ago
get number from string
no description available
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
javascript
Submitted by
Gecko Pico
-
19 hours ago
MongoDB connection string has username and password
Test if a mongo db connection string has a username and password declared in it. Doesn't work with with multi host ATM
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
python
Submitted by
anonymous
-
20 hours ago
conditional phone numbers
no description available
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre2
Submitted by
AiAbdrahim
-
20 hours ago
Email
A valid Email
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre2
Submitted by
AiAbdrahim
-
20 hours ago
Email
no description available
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre2
Submitted by
anonymous
-
21 hours ago
URL
This pattern can detect URLs.
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
javascript
Submitted by
https://stackoverflow.com/users/3832970/wiktor-stribi%c5%bcew
-
a day ago
match words between '::' '::'
matches words between :: characters ("some text ::this should be matched::")
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre2
Submitted by
Grayson Spidle
-
a day ago
Escaped Character Finder
Flavor: PCRE2 Finds escaped characters. No matter how many \ are present, it will always match either \\\. or \. (where . is the character).
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre2
Submitted by
Alan Nevill
-
a day ago
AOC 2020 day 18
no description available
0
0 upvotes, 0 downvotes (0% like it) (You must be signed in to vote)
pcre2
Submitted by
anonymous
-
a day ago
Sagitta - LTEPIC
no description available
1
2
3
4
...
668
remove comments from php code
Regular Expression
pcre
@
(?(DEFINE)
(?<next_open_tag>
[^
<
]
*+
(?i:
<
++
[^
<?s
]
[^
<
]
*
|
<
++
(?!
\?
php
|
\?
=
|
script
\s
*
language
\s
*
=
\s
*
(
[
\'
"
]
?
)
php
\g{-1}
\s
*
>
)
[^
<
]
*
)*+
(?i:
<
++
(?:
\?
php
|
\?
=
|
[^
>
]
+
)
|
\z
)
)
)
\A
(?&next_open_tag)
\K
|
[^
'"`/#<?
]
*+
(?:
'
(?:
[^
'
\\
]
+
|
\\
.
)*+
'
[^
\'
"`/#<?
]
*
|
"
(?:
[^
"
\\
]
+
|
\\
.
)*+
"
[^
\'
"`/#<?
]
*
|
`
(?:
[^
`
\\
]
+
|
\\
.
)*+
`
[^
\'
"`/#<?
]
*
|
/
(?!
[
/*
]
)
[^
\'
"`/#<?
]
*
#
stop
for
//
or
/*
|
#
if
close
tag
?>
\?
(?:
>
(?&next_open_tag)
[^
\'
"`/#<?
]
*
|
)
|
<
(?:
#
heredoc
or
nowdoc
<<
[
\
\t
]
*
(
[
\'
"
]
?
)
(
[
a
-
zA
-
Z_
\x7f-\xff
]
[
a
-
zA
-
Z0
-
9_
\x7f-\xff
]
*
)
\g{-2}
[
\
\t
]
*
[
\r\n
]
(?-s:
.
*+
[
\r\n
]
)*?
\g{-1}
[
\r\n
;
]
[^
\'
"`/#<?
]
*
|
(?i:
/script
\s
*
>
)
(?&next_open_tag)
[^
\'
"`/#<?
]
*
|
[^
\'
"`/#<?
]
*
)
)*+
\K
(?:
(?:
//
|
\#
)(?:
[^
\n
?
]
+
|
\?
(?!
>
)
)*+
#
single
line
comment
//
и
#
|
/
\*
(?:
[^
*
]
+
|
\*
(?!
/
)
)*+
\*
/
#
multi
line
comment
/*
*/
)?
@
xsg
Open regex in editor
Description
Loading markdown...
Submitted by
anonymous
- 6 years ago
Regular
Expressions
101
Please wait while the app is loading...
Please enable JavaScript to use this web application.