I don’t think .Net supports POSIX regular expression syntax, i.e. “[:alnum:]”.
This means that expression is too matchy. For example, it matches “somecreatedate”
You can replace “[:alnum:]_” with just “\w”,
public static Regex VerifyFragmentRegEx = new Regex("([^\\w]|^)+(--|;--|;|%|/\\*|\\*/|@@|@|char|nchar|varchar|nvarchar|alter|begin|cast|create|cursor|declare|delete|drop|end|exec|execute|fetch|insert|kill|open|select|sys|sysobjects|syscolumns|table|update)([^\\w]|$)+",
RegexOptions.Singleline | RegexOptions.Compiled | RegexOptions.IgnoreCase);
mythz
2
ok thx, added in this commit which is available from v4.5.13 that’s now available on MyGet.