Commit 1393169c authored by Marc Gravell's avatar Marc Gravell

regex tweak

parent 977bbb0a
...@@ -2081,10 +2081,10 @@ public static void PackListParameters(IDbCommand command, string namePrefix, obj ...@@ -2081,10 +2081,10 @@ public static void PackListParameters(IDbCommand command, string namePrefix, obj
} }
} }
var regexIncludingUnkown = @"([?@:]" + Regex.Escape(namePrefix) + @")(\s*(?i)unknown(?-i))?"; var regexIncludingUnknown = @"([?@:]" + Regex.Escape(namePrefix) + @")(\s+(?i)unknown(?-i))?";
if (count == 0) if (count == 0)
{ {
command.CommandText = Regex.Replace(command.CommandText, regexIncludingUnkown, match => command.CommandText = Regex.Replace(command.CommandText, regexIncludingUnknown, match =>
{ {
var variableName = match.Groups[1].Value; var variableName = match.Groups[1].Value;
if (match.Groups[2].Success) if (match.Groups[2].Success)
...@@ -2104,7 +2104,7 @@ public static void PackListParameters(IDbCommand command, string namePrefix, obj ...@@ -2104,7 +2104,7 @@ public static void PackListParameters(IDbCommand command, string namePrefix, obj
} }
else else
{ {
command.CommandText = Regex.Replace(command.CommandText, regexIncludingUnkown, match => command.CommandText = Regex.Replace(command.CommandText, regexIncludingUnknown, match =>
{ {
var variableName = match.Groups[1].Value; var variableName = match.Groups[1].Value;
if (match.Groups[2].Success) if (match.Groups[2].Success)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment