Robert Simpson有一个很好的例子,可以在sqlite查询中使用REGEX函数:
// taken from http://sqlite.phxsoftware.com/forums/p/348/1457.aspx#1457 [SQLiteFunction(Name = "REGEXP", Arguments = 2, FuncType = FunctionType.Scalar)] class MyRegEx : SQLiteFunction { public override object Invoke(object[] args) { return System.Text.RegularExpressions.Regex.IsMatch(Convert.ToString(args[1]),Convert.ToString(args[0])); } } // example SQL: SELECT * FROM Foo WHERE Foo.Name REGEXP '$bar'