Is your feature request related to a problem? Please describe.
Some naughty strings like groups can cause StackOverflowException.
Describe the solution you'd like
One way to prevent that could be to let the caller submit a "timeout" duration like what the BCL provides when calling Regex.IsMatch
ReadonlySpan<char> input = ...;
var filter = input.ToFilter<T>(timeout: TimeSpan.FromSeconds(30));
By explicitly defining a timeout, the developer would acknowledged that converting the input could fail.
Going one step further could be to introduce a breaking change in the ToFilter<T> extension method and make it returns an Option<IFilter, TimeoutException>
Describe alternatives you've considered
I could try to prevent those stack overflow by analyzing the input and eliminating cases where GroupExpression are nested too deeply, either with a global parameter (like the "maxdepth" parameter System.Text.Json provides
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
Some naughty strings like groups can cause
StackOverflowException.Describe the solution you'd like
One way to prevent that could be to let the caller submit a "timeout" duration like what the BCL provides when calling Regex.IsMatch
By explicitly defining a timeout, the developer would acknowledged that converting the input could fail.
Going one step further could be to introduce a breaking change in the
ToFilter<T>extension method and make it returns anOption<IFilter, TimeoutException>Describe alternatives you've considered
I could try to prevent those stack overflow by analyzing the input and eliminating cases where
GroupExpressionare nested too deeply, either with a global parameter (like the "maxdepth" parameter System.Text.Json providesAdditional context
Add any other context or screenshots about the feature request here.