On Fri, Jan 12, 2007 at 03:17:36PM -0600, Sam Martin wrote:
> ". . . (?!) is a pattern that never matches anything, so when the
> regex engine reaches it, it is forced to backtrack. "

Aye, and that's the flaw I see in this scheme...  Backtracking.
Whenever the regex engine hits the unmatchable (part of) your regex,
it will happily back up, be a little less greedy, and try again to
find a match.  This can be a very expensive process, especially if your
unmatchable bit is preceded by (or includes) a .* or similar token.

Isaac and Eric have the right idea:  Don't use an unmatchable regex, use
a flag that tells you not to run a regex at all.  It'll be much faster.

-- 
I would rather be exposed to the inconvenience attending too much Liberty
than those attending too small degree of it.
  - Thomas Jefferson