PHP / Regex: detect string after ?>

(?<=\?>)(\s)+$

(?<=\?>) : positive lookbehind to find ?> (but not capture it)

(\s)+ to find any combinaison of spaces, new lines, tabulations, … after the tag

$ to match the end of the string

Leave a Comment