Regular Expressions 101

Library entries

0
dotnet

for killerswim

a
Submitted by anonymous - 5 days ago
0
pcre

strip host port

removes port number from URL
Submitted by pc - 9 days ago
0
java

Martch Letras y Parentesis

Martch Letras y Parentesis
Submitted by Daniel Gonzalez - 9 days ago
0
pcre

Proxy Matcher

Validate 1-223.0-255.0-255.0-255:1-65535
Submitted by dev.tntd2k2 - 12 days ago
0
pcre

latlonlatlon

gg
Submitted by anonymous - 13 days ago
0
java

Riedler's 2nd URL regex

why did I make this?
Submitted by Riedler - 20 days ago
1
golang

Home

Dj dus er geen je een je aan je enige eerst een he we er
Submitted by Webmaster - 22 days ago
1
pcre

ENEL T5 Mono

T
Submitted by anonymous - 24 days ago
0
golang

Get digits

Trying to get digits
Submitted by Arthur Silva - a month ago

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 - 8 years ago