• Cadavre (5/8/2012)


    Any disputes about my test results? Because so far I'm thinking that I don't want RegEx in my database 😛

    Just as the advice is not to use CLR functions to do data access best done with T-SQL so the advice has to be not to use RegEX for things that are best done with either custom CLR functions or out-of-the-box SQL.

    Your test results illustrate this very nicely.

    With the caveats of performance I'd like to reitterate the point that RegEx can offer functionality far beyond simple LIKE, PATINDEX, CHARINDEX, REPLACE operations. It's a trade-off between functionality and performance.

    Solomon and I had several exchanges of email over this article and there were quite a few things that were left out simply because the article was getting too big and too unwieldy. There is definitely a case for an article on the performance angle for RegEx particularly with the more complex RegEx operations.

    The simple examples in this article were really more of a primer for RegEx. Again, the point that it is a dangerous weapon in the hands of the inexperienced is one fairly made.