CSharpVerbalExpressions
CSharpVerbalExpressions copied to clipboard
Ranges cause invalid Regex
When using the .Range
method with range arrays greater than 3, it causes invalid Regex to be output. An example can be seen with the following snippet taken from a Unit test and modified:
var verbEx = VerbalExpressions.DefaultExpression;
object[] range = new object[4] { 1, 6, 7, 12 };
verbEx.Range(range);
That expression outputs [1-126-7]
which is obviously invalid regex. Not sure what is supposed to happen here? Maybe throw an ArgumentException
?