Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Regex] Document the fact that expressions must have balanced parentheses. #11

Open
aercolino opened this issue Nov 24, 2014 · 1 comment

Comments

@aercolino
Copy link
Owner

It is a requirement in Regex::count_matches(). Exceptions are currently thrown if the pattern to count contains duplicate numbers and those parentheses are not balanced. That means that all expressions should have balanced parentheses even if they contain variables, even if they are contained in variables.

I don't think it's worth to go through the pain of relaxing this requirement.

@aercolino aercolino changed the title [Regex] Document the fact that expressions must have balanced parenthesis. [Regex] Document the fact that expressions must have balanced parentheses. Nov 24, 2014
@aercolino
Copy link
Owner Author

Notice that the requirement for balanced parenthesis is limited to duplicate numbers subexpressions (which are alternations). In fact there is a new test (count_matches_allows_to_count_broken_expressions) which confirms that unbalanced parenthesis are supported in other places. But again, this is something to handle with care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant