Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

Add built-in support for regular expressions in T-SQL

LIKE is very limited in what it can differentiate. The CLR has much more robust handling for regular expressions, but it's hard to get to from T-SQL.

Could we add built-in functionality in T-SQL to do regular expression pattern matching?

24 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    AdminMicrosoft SQL Server (Product Manager, Microsoft Azure) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    Upvotes: 54

    <=-=Sep 4 2007 12:29PM=-=>

    If this is considered for a future version of SQL Server, please implement it according to the ISO SQL standard. In other words, implement the SQL Standard , which provides regular expression support through the operator [NOT] SIMILAR TO, which in the standard remains separate from LIKE.

    <=-=Sep 5 2007 7:05AM=-=>

    Like Steve, I would also like to stress that any implementation should be as per ANSI (SIMILAR predicate). The CLR functionality is not a relevant design consideration.

    <=-=Oct 15 2007 8:43AM=-=>

    This is a request we’ve heard a lot, and it’s of obvious value. I can’t promise when we’ll get to it—-it’s doubtful for this release—-but this is certainly on our radar.

    Cheers,
    -Isaac

    <=-=Mar 24 2010 2:54PM=-=>

    Hi,
    I have resolved this request as duplicate of feedback item below:

    https://connect.microsoft.com/SQLServer/feedback/details/261342/regex-functionality-in-pattern-matching?wa=wsignin1.0


    Umachandar, SQL Programmability Team

    <=-=Mar 24 2010 3:59PM=-=>

    Resolved as duplicate.


    Umachandar

    <=-=Mar 25 2010 11:10AM=-=>

    Resolved as duplicate.


    Umachandar

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Aaron Abdis commented  ·   ·  Flag as inappropriate

        It was possible to get this function with CLR, but we have more and more of our clients moving to cloud-hosted SQL Server instances, such as AWS, where they simply do not even have the ability to enable CLR. So CLR implementations are becoming less and less plausible.

        As such, it is becoming more and more necessary for this to be implemented in SQL Server itself, without the need for CLR.

        Pretty please, with whipped cream... and sprinkles and a cherry on top?

      Feedback and Knowledge Base