microsoft sql相当于mysql的REGEXP

dbo*_*101 5 regex mysql t-sql sql-server

我正在尝试重建我在Microsoft sql中为mysql创建的数据库查询.我在Microsoft sql中寻找一个术语,其行为类似于REGEXP

这是一个如何使用该术语的例子

select *
from   musicdetails
WHERE  artistname REGEXP '^".mysql_escape_string($_GET['search'])."$'
Run Code Online (Sandbox Code Playgroud)

任何帮助将非常感激

lep*_*pie 5

在这里(编译为SQL CLR程序集):

using System.Collections;
using System.Text.RegularExpressions;
using Microsoft.SqlServer.Server;

public partial class UserDefinedFunctions
{
  [SqlFunction]
  public static bool RegexMatch(string expr, string regex)
  {
    return Regex.IsMatch(expr, regex);
  }

  [SqlFunction]
  public static string RegexReplace(string expr, string regex, string replace)
  {
    return Regex.Replace(expr, regex, replace);
  }

  [SqlFunction(FillRowMethodName="GetToken", 
       TableDefinition="Value nvarchar(max)")]
  public static IEnumerable RegexSplit(string expr, string regex)
  {
    return Regex.Split(expr, regex);
  }

  public static void GetToken(object row, out string str)
  {
     str = (string) row;
  }
}
Run Code Online (Sandbox Code Playgroud)