Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
<\?php((?:(?:(?!php)[^?]>|(?!php)[^?]|...\?[^?])*))\?>
/
g

Description

it's to use to get all <?php ?> tags. not easy to implement because some link in php with ? or > can make trouble to get the closure ?>

Submitted by simon - 9 years ago