-
Notifications
You must be signed in to change notification settings - Fork 27.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid regex is not shown to be invalid #93903
Comments
/needsMoreInfo Is that inside the editor or global search? |
Backslash ( /a/.test('a') // true
/\a/.test('a') // true In VSC text search it makes a difference: Version: 1.43.2.Commit: 0ba0ca52957102ca3527cf479571617f0de6ed50 Date: 2020-03-24T07:38:38.248Z Electron: 7.1.11 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.16299 (I'm not sure but I think that regex engine used for document and file text search is not "just vanilla JS" (ripgrep perhaps?), and I'm not even sure if 100% compatibility with JS regex peculiarities is a goal. Nice bug anyway, good catch!) |
It is regarding text search within the editor. Didn't try the global one. |
Well, the same setting worked on Windows, but not in Linux. |
Removing the unicode flags makes the regex valid: I think the validation code (that would display an error) forgets to use the unicode flag. |
Issue Type: Bug
This regex:
([^?]+)\?([^:]+)\:(.*)
is supposed to find lines like the following:res = foo?bar:baz
.Instead it states: "No results"
I was told this exact same condition works under Windows. Both most recent versions, but different Electron versions. Maybe that's the thing?
regex tester
VS Code version: Code 1.43.2 (0ba0ca5, 2020-03-24T07:52:11.516Z)
OS version: Linux x64 5.4.27-1-MANJARO
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: unavailable_off
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: