Just a short one here.
I was looking for a way to find all tags in a text (< and >) UNLESS they were PHP tags (<?php) or HTML comment tags (<!--).
The regexp for this was as follows:
$str = preg_replace('/\<(?!\\?)(?!\\!)(.*?)\>/', '', $str);
The key was that if you want multiple excludes (?()) then you just add them after each other. I was going mad trying to find a way to add them inside the same parenthesis.
Well, might be good to know :P