2

For example:

where strword match with {%{J{GC * GC}J} or strword={%{J{GC * GC}J}
3
  • possible duplicate of stackoverflow.com/questions/194652/… Commented May 8, 2012 at 17:04
  • 1
    @Roman - It is a very similar question but other post specifically states they do not want a CLR approach. If this poster is OK with CLR then it might not be a duplicate question. Commented May 8, 2012 at 17:07
  • 2
    "Native" T-SQL has no regular expression support - you'll need e.g. a SQL-CLR library (.NET library) to add this capability Commented May 8, 2012 at 17:13

1 Answer 1

6

I typically try to avoid posting answers that are simply links to somewhere else. But in this case it's a fairly big answer as you have to involve CLR in your approach.

So - in this case I'm going to make an exception and just give you a link. I feel better about it since it's an official Microsoft doc and they are pretty good about not moving things around.

Here's the walk through from Microsoft on using RegEx with SQLServer.

It has good sample code and is extensive in it's coverage. If your OK with adding CLR to your solution then it should give you exactly what you need.

Update: Turns out Microsoft did in fact change that link. Another walk through by a respected company (Red Gate) can be found here: https://www.red-gate.com/simple-talk/sql/t-sql-programming/clr-assembly-regex-functions-for-sql-server-by-example/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.