• I very much appreciate the time you've spent on that great explanation, Solomon. And I absolutely believe that you've hit the nail on the head when you said...

    ...if you have a pattern that can be tested side-by-side with a T-SQL equivalent then maybe you should just use the T-SQL. Hence, what RegEx should be used for is situations that are not going to be able to be performance tested because there will be no T-SQL equivalent to compare against.

    That's the whole crux of the matter and the very much needed point that people tend to leave out when they write articles about SQL Server and Regex. Without mentioning that point, there's going to be a lot of inexperienced folks that use Regex for things that they really should be using T-SQL for. I might go so far as to say that if youre trying to find items like the example you gave, then the data probably shouldn't be allowed anywhere near SQL Server until it's been cleaned up and sorted out a bit. It's kind of like people trying to use Full Text Search to do the things that you really need a more dedicated product for.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)