• As I said in my original post, it's not an exact science and I'm really just looking for a "good enough" solution.  Because we don't control the incoming data we could get anything and nothing I write is ever going to accommodate every situation.  Neither of those patterns occurs frequently enough in the data to be worth considering.

    I'm not really concerned about that side of things though.  As I said, my current approach is getting me close enough to be happy with the result.  I'm only really concerned with performance and replacing the cursor.