Giter Site home page Giter Site logo

sql-server-regex's Introduction

SQL Server Regex

SQL Regex Logo

SQL-Server-Regex gives you the power to run regular expressions inside SQL Server queries. It works by using SQL CLR functions to call the C# System.Text.RegularExpressions library.

Examples

Match

The RegexMatch() scalar function lets you call a regular expression against a string, and returns the first result if there is a match.

Match SSMS example

Matches

The RegexMatches() table-valued function lets you call a regular expression against a string, and returns all matches.

Matches SSMS example

Group Match

The RegexGroupMatch() scalar function lets you call a regular expression with named groups against a string, and returns the group name you specify.

Group Match SSMS example

Replace

The RegexReplace() scalar function lets you call a regular expression to find-and-replace inside a string. You can also match parts of a string and re-arrange them using references.

Replace SSMS example

Split

The RegexSplit() table-valued function lets pass a regular expression against a string to split it into pieces, and returns the pieces.

Split SSMS example

Installation

You can install sql-server-regex on most versions of SQL Server. This works the same for virtual machines or cloud VMs.

You can also install sql-server-regex onto AWS RDS.

Note: for SQL Server 2005, 2008, and 2008R2, if you can't install the DLL directly, you may you need to compile the assembly yourself using .NET 2.0 and an old version of Visual Studio.

Testing

This work has been tested, both for functionality and performance.

Resources

sql-server-regex's People

Contributors

devnambi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.