Skip to content

Improved Feedback for RegEx in Template

🚀 Feature Request

Summary

At the moment, only a generic error is provided when a regular expression fails to save (“Pattern Backend failed to save... Regular Expression invalid”), but it does not explain why the regex is invalid or what characters/patterns are allowed. This is confusing for users and makes template creation unintuitive.

Problem to Solve / User Story

As a user creating regular expression templates, I want clear feedback and guidance when a regex fails validation, so that I can correct it easily without guessing what is wrong.

Currently, invalid regex patterns are rejected silently with only a backend error, leaving users frustrated.

Proposed Solution

Show a detailed error message when a regex fails validation, explaining:

  • Which part of the regex is invalid
  • Allowed characters and syntax
  • Examples of valid patterns

Benefits

  • Makes template creation much more intuitive and user-friendly
  • Reduces time spent debugging regex errors

Additional Context

Adjustments needed when switching from BaseX to Saxon. However, an explanation of why the regex cannot be saved would also be helpful when switching to Saxon.

Relevant Logs or Screenshots (if applicable)

image