Search code examples
phpphp-shorttags

Find and replace php <? short tags exclude xml and <?= in Netbeans


I am working on an old project and found the previous developer has used <? all over the place.

I know how to search and replace all Literal occurrences but is there another way to find the exact matches?

This link only outlines how to do a search and replace but not a detailed search and replace - Search and Replace Entire Project (Netbeans)

Is there a regex or something I can use to replace every <? occurance and exclude any <?= , <?php , <?= or <?xml


Solution

  • You can try TextCrawler (http://www.digitalvolcano.co.uk/textcrawler.html) program, which support regex for find and replace. Use this regexp:

    \<\?[^=|xml|php]
    

    And replace it with <?php