Edward Tanguay
Edward Tanguay

Reputation: 193372

How to search with a regular expression in Eclipse?

How can I use Eclipse to search all files which have this on their first line:

<?

instead of this:

<?php

The following isn't working:

alt text

Upvotes: 1

Views: 366

Answers (1)

Rob
Rob

Reputation: 2148

Do your files have any spacing or indentation? That could cause your regex not to work.

Your regex will match this

<?

But it won't match any of these because of the spacing.

<? 
 <?
    <?

If you want a regex that allows for spaces and indents try this

^\s*<\?\s*$

Upvotes: 3

Related Questions