Home Forums SQL Server 2008 T-SQL (SS2K8) Determine which pattern comes first in a string<!-- 864 --><!-- 864 --> RE: Determine which pattern comes first in a string<!-- 864 --><!-- 864 -->

  • Eirikur Eiriksson (8/25/2014)


    sqldriver (8/25/2014)


    That's pretty cool. I like the position column. I don't think you need the extra step with the prefixes, though. Their position (at least in my actual data) isn't a very reliable indicator of anything.

    Just demonstrating a method of filtering out the false positives, i.e. "this"-->"his". As I stated before, it is not a perfect solution but could be a base for one though. The weakness would be a recurrence of a pattern within the "string".

    😎

    Ah, I see. In my attempt to make this easy for everyone to work with, I made it more complicated. Actual values that I'm searching for are like .b. and .ib., and not terribly duplicate-prone within each string.

    On the plus side, you've won a fabulous MUSK OX!