The age filter detects Age: 47 but not Age = 47 or Age - 47. The pattern in phileas/filters/age_filter.py allows only an optional colon:
re.compile(r"\b(age)(d)?(\s*:?\s*)[0-9.]+\b", re.IGNORECASE)
Java broadened this in philterd/phileas#332. Its separator is \s*(?:[:=-]\s*)?, which also accepts = and -, and keeps the whitespace inside the optional group so a run of whitespace can only be matched one way. The current \s*:?\s* has that same ambiguity: two adjacent \s* can split a whitespace run n+1 ways, so a non-matching input backtracks quadratically. SonarCloud flagged the equivalent Java expression as java:S8786.
Acceptance Criteria
The age filter detects
Age: 47but notAge = 47orAge - 47. The pattern inphileas/filters/age_filter.pyallows only an optional colon:Java broadened this in philterd/phileas#332. Its separator is
\s*(?:[:=-]\s*)?, which also accepts=and-, and keeps the whitespace inside the optional group so a run of whitespace can only be matched one way. The current\s*:?\s*has that same ambiguity: two adjacent\s*can split a whitespace run n+1 ways, so a non-matching input backtracks quadratically. SonarCloud flagged the equivalent Java expression asjava:S8786.Acceptance Criteria
Age = 47andAge - 47are detected, alongside the existingAge: 47Age:47,Age : 47,Age 47)coverage: 47,mileage: 45000)2026-01-15are still not detected as ages\s*:?\s*tests/test_age_detection.py