![]() | RegularExpressionsRegexReplace Method |
Namespace: sqx
public static SqlChars RegexReplace( SqlChars s, SqlString Pattern, SqlString Replacement )
/* ATENTION: RegexReplace is a powerfull tool. Care should be taken in it's use. Test your patterns first. */ DECLARE @Pattern nvarchar(4000) = sqx.RegexEscape(N'John Doe') UPDATE SomeTable SET SomeField = sqx.RegexReplace(SomeField, @Pattern, N'Dr. Doe, John') WHERE sqx.RegexIsMatch(SomeField, @Pattern) = 1