Skip to main content

validate_expression

Function validate_expression 

Source
pub fn validate_expression(expr: &str) -> Result<(), String>
Expand description

Validates an ELO expression for syntax and safety

§Security Checks

  • Length limits (max 10,000 characters)
  • Balanced parentheses
  • Allowed character set only
  • No SQL injection patterns
  • No shell command patterns

§Arguments

  • expr - User-provided ELO expression

§Returns

  • Ok(()) if expression is valid
  • Err(String) with error message if validation fails