Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?: <\?php (?: [^"'\/<\?]+ | (?: "(?:[^\\"]|\\[\s\S])*" | # '(?:[^\\']|\\[\s\S])*' #| \/\*(?:[^\*]|\*[^\/])*\*\/ | (?:\#|\/\/).+(?:\n|$) | (?: <<<\s* (?: (?:'([a-zA-Z0-9_]+)'\s*?\n)(?:[^\n]*\n)*?\s*\1\s*?;?\s*?(?:\n|$) | (?:([a-zA-Z0-9_]+)\s*?\n)(?:[^\n]*\n)*?\s*\2\s*?;?\s*?(?:\n|$) ) ) ) | (?:[^?]|\?[^>]) )* (?:\?>|$) )
/
xgi

Description

recognize php code

Submitted by Chris Ottersen - 9 years ago