Regex patterns are emitted as raw Go string literals. A pattern containing a backtick therefore produces invalid generated Go source.
For example, this schema pattern includes the permitted HTTP token characters:
pattern: "^[!#$%&'*+.^_`|~0-9A-Za-z-]+$"
The generated raw string is terminated by the embedded backtick, and the generated package does not compile.
#378 and #380 address related quoting problems but do not cover embedded backticks.
Expected behavior:
- Generated Go compiles when a regex pattern contains a backtick.
- The regex received at runtime is identical to the pattern in the schema.
- Patterns containing backslashes, quotes, Unicode, or control characters are represented without changing their value.
Regex patterns are emitted as raw Go string literals. A pattern containing a backtick therefore produces invalid generated Go source.
For example, this schema pattern includes the permitted HTTP token characters:
The generated raw string is terminated by the embedded backtick, and the generated package does not compile.
#378 and #380 address related quoting problems but do not cover embedded backticks.
Expected behavior: