CSharpVerbalExpressions icon indicating copy to clipboard operation
CSharpVerbalExpressions copied to clipboard

Ranges cause invalid Regex

Open jduncanator opened this issue 11 years ago • 0 comments

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?

jduncanator avatar Aug 30 '13 09:08 jduncanator