Finding all PHP Short Open Tags in Eclipse

PHP short open tags were a quick way to enter the PHP code inside HTML pages through a simple <? instead of <?php. This practice is now deprecated.

To find all PHP’s short open tags ( <? ) inside an Eclipse project you have to enter a simple but effective regexp in the search panel:

<\?(?!php|xml)

To do this you have to select your project and press CTRL-H, then enter the following:

php-short-open-tagsPress “search” and that’s it!

Please note that the regexp will cut off all valid <?xml declarations also!

 

Leave a Comment.