X[^XH]*H[^HD]*D [download]
By the way, the non greedy modifier is deceptively complex and you'll have better luck by avoiding it.
In reply to Re: Regex logic by ikegami in thread Regex logic by orange