Skip to content

Conversation

willibrandon
Copy link

Fixes #6

Implements eager validation for expression syntax errors, making them non-throwing in the TryCompile path.

Changes

  • Added ExpressionValidator to validate expressions before compilation
  • Invalid regular expressions in IsMatch()/IndexOfMatch() are detected during validation
  • Unknown function names are reported gracefully instead of throwing
  • CI modifier usage is validated - only allowed on functions with StringComparison parameter
  • Multiple validation errors are collected and reported together

Testing

  • Added test suite in ExpressionValidationTests.cs
  • All existing tests pass
  • Backward compatibility maintained - Compile() still throws for invalid expressions

…x errors

- Add ExpressionValidator to validate expressions before compilation
- Validate regex patterns in IsMatch()/IndexOfMatch() without throwing
- Detect unknown function names gracefully
- Validate CI modifier usage on functions that support it
- Return validation errors via TryCompile() instead of throwing
- Add test suite for validation scenarios
- Fix ${regex} to {regex} in log message (was outputting literal text)
- Rename CaseSensitiveFunctions to CaseInsensitiveCapableFunctions
- Add test for IndexOfMatch with invalid regex in Compile()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eager/non-throwing checks for more expression syntax errors
1 participant