vscode-yaml
vscode-yaml copied to clipboard
Invalid regex using pattern for case insensitivity "(?i)"
Describe the bug
Using a pattern like "pattern": "(?i)(SecurityGroup)", wil break all validation in the same scheme,
Expected Behavior
Should work, same scheme works just fine for json documents with the build-in extension in vscode. Also validates fine with regex engines i tried.
Current Behavior
With error: Message: Request textDocument/hover failed with message: Invalid regular expression: /(?i)(Dynamic|Static)/: Invalid group
Steps to Reproduce
Use any pattern beginning with (?i) in your scheme.
Environment
- Windows
I can reproduce this issue and it seems to affect all inline regex modifiers. This is probably because JavaScript/ECMA 262 is used as the parser resulting in a unparsable regex. It does not support this particilar syntax (but should support /string/i). Depending on the JSON Schema implementation, the example you provided is a valid regex or not (PHP parses it correctly).