Skip to content

Latest commit

 

History

History
19 lines (10 loc) · 760 Bytes

replace.md

File metadata and controls

19 lines (10 loc) · 760 Bytes

Replace

SQL Regex Logo

RegexReplace() is a scalar function that lets you find-and-replace inside a string using regular expressions. RegexReplace() is a SQL CLR function that exposes the System.Text.RegularExpressions' Replace() method.

Let's look at a few examples, inspired by another handy Regular Expressions tutorial

Screenshot

Replace SSMS example

Change a sentence

select dbo.RegexReplace('Hello, my name is John Doe', 'my name is (.+)', 'my name is not $1')