You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Malformed regex in a syntax rule bypasses the reraise_exceptions setting and throws uncaught on every file open/save #164
reraise_exceptions (default false) is documented as suppressing console errors from rule matching unless explicitly enabled. Two of the three rule-matching code paths honor it correctly (glob_matches and function_matches in ApplySyntax.py both catch exceptions and check self.reraise_exceptions). The third path, plain regex rule matching (regexp_matches, used for first_line/interpreter/file_path/contains rules), has no exception handling at all — a malformed pattern raises re.error directly from re.match/re.search, uncaught, regardless of the setting.
Repro steps
Add a rule to ApplySyntax's User settings under "syntaxes":
Open (or save) any file — this rule has no extensions filter so it's evaluated for every file.
The console shows an uncaught re.error from regexp_matches, even with reraise_exceptions left at its default false.
Suggested fix
Wrap the re.match/re.search call in regexp_matches in the same try/except + reraise_exceptions check already used in glob_matches and function_matches.
Found via source review + a live test that was interrupted by an unrelated local environment issue before the exact traceback could be captured on this machine, but the code path is unambiguous — happy to help verify further if useful.
Activity
dpc00 commentedon Oct 27, 2026
Claude reports: closing this after 30 days with no response. Reopen it if it is still relevant.