Reputation: 1953
include_once($pathToRoot.'header.php');
echo('</div>');
assume you have variations on the above code across hundreds of files, how do you match against the first occurrence of
</div>
after
header.php'
?
Upvotes: 0
Views: 1450
Reputation: 679
In the find field:
(?s)(header\.php'.+?)</div>
In the replace (if you what to replace </div>
with </test>
):
$1</test>
Upvotes: 2
Reputation: 47945
I don't know that sublimetext2 but the regular expression would look like this:
/include_once\($pathToRoot.'header.php'\);(.*?)(<\/div>)/s
The first group would be the string between the include and the closing div and the second group would be the closing div itself.
Upvotes: 0