24 lines
598 B
C#
24 lines
598 B
C#
using Microsoft.SqlServer.Server;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data.SqlTypes;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
|
public class Like
|
|
{
|
|
[Microsoft.SqlServer.Server.SqlFunction(DataAccess = DataAccessKind.Read, IsDeterministic = true, Name = "RegLike")]
|
|
public static SqlString RegLike(SqlString str, SqlString likestr)
|
|
{
|
|
string stro = str.ToString();
|
|
string likestro = likestr.ToString();
|
|
if (Regex.IsMatch(stro, likestro))
|
|
{
|
|
return "1";
|
|
}
|
|
else { return "0"; }
|
|
}
|
|
}
|
|
|