CLR to use Regex

  • Hi

    I am trying to replace a call out to sp_OACreate whcih is using a Regex VBScript object.

    Under the old hierarchy, the object model was:

    Matches

    -Match

    -SubMatches

    -SubMatch

    However, under the new .NET Regex, the object available in CLR are:

    Matches

    -Match

    -Groups

    - Group

    -Captures

    Capture

    Now I can't find any clear explanation of the new level which has been introduced, so I am finding it difficult to map one to the other.

    Can anyone help? OR point me at some documentation?

  • The BOL is probably the best reference point for you:

    http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.match.groups.aspx%5B/url%5D

    Is there something specific that you are having a problem with this? Can you provide an example of your string, the regex, and what you expect the output to be? I rarely ever go past the matches collection and iterate over the individual match objects it contains when using regex in any CLR programming.

    Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
    My Blog | Twitter | MVP Profile
    Training | Consulting | Become a SQLskills Insider
    Troubleshooting SQL Server: A Guide for Accidental DBAs[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply