Regular Expressions 101

Sponsors

Library entries

16
pcre

Cron schedule

Validate cron lines (even the ones commented out)
Submitted by anonymous - 6 years ago
12
pcre

Match Gmail Email

Match Gmail Email
Submitted by Óscar Enríquez - 7 years ago
11
pcre

Codice fiscale

Check "codice fiscale"
Submitted by Luca - 7 years ago
10
pcre

remove comments from php code

no description available
Submitted by anonymous - 7 years ago
10
python

entity

no description available
Submitted by anonymous - 6 years ago
9
pcre

Validate Base64 single-line string

no description available
Submitted by ka. - 9 years ago
9
pcre

Fixo LDN CSP e SEM CSP

no description available
Submitted by Marcos Müller - 7 years ago
9
pcre

only numbers

A string with only numbers in
Submitted by Gotts - 6 years 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 - 7 years ago