Regular Expressions 101

Community Patterns

capture balisephp

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