Regular Expressions 101

@regex101
Donate
Sponsor
Contact
Bug Reports & Feedback
Wiki
Whats new?

Library entries

0
pcre2
Submitted by Pythack - a day ago

Don't allow two consecutive "."

Don't allow two consecutive .
1
pcre2
Submitted by Pythack - a day ago

Binary code regular expression

Regular expression for binary code.
0
pcre
Submitted by anonymous - 2 days ago

model value

for Levi
0
pcre2
Submitted by Suraj Shah - 2 days ago

Youtube Regex

Regex for youtube pattern
0
pcre2
Submitted by anonymous - 3 days ago

Regix xinj xof

Bebebe
0
pcre2
Submitted by yimao - 3 days ago

KUN task name tempalte

Quick template to name a KUN task
0
python
Submitted by guif - 4 days ago

regex_restauration_V3

regex
0
python
Submitted by guif - 4 days ago

REGEX_SAUF_RESTAURATION_V1

regex
0
javascript
Submitted by anonymous - 4 days ago

fopen

asdf
0
pcre2
Submitted by Vipul Jha - 4 days ago

Indian Pincode

Indian area Pincode regex

remove comments from php code

Vote

10

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

Description

Loading markdown...
Submitted by anonymous - 6 years ago