Open RokeJulianLockhart opened 5 months ago
Editor find widget uses JS regexp engine. If you switch to ECMAScript(JavaScript) in regex101 you'll see error as well.
On another note: VS Code doesn't match new line with .*
for perf reasons. [\s\S\n]*
should match everything across multiple lines.
@IllusionMH, is there no way to force VS Code to match /n
with .*
?
[\s\S\n]*
should match everything across multiple lines.
\n
should be mentioned in regexp explicitly to force multiline matches
Seems by design but moving upstream to confirm
@mjbvz this issue is about VS Code search widget, not related to TS at all.
This relates to VS Code, not TS:
@IllusionMH That's what I thought too but the issue is very unclear:
@RokeJulianLockhart Please provide full repo steps
https://github.com/microsoft/vscode/issues/216105#issuecomment-2174362276
@mjbvz, what reproduction steps are absent? I've provided sample code and the expression itself, and the version of VSC I'm using.
Share what are you doing. Provide exact steps (with screenshots if useful)
@RokeJulianLockhart you hadn't stated that the bug was about the ctrl+F Find
regex
https://github.com/microsoft/vscode/issues/216105#issuecomment-2174555495
@mjbvz, per the undermentioned, I'm trying to select with RegEx the manually selected line (from PHOTO
to the \n
before REV
) but PHOTO(?s)(.*)REV
- RegEx which selects that line when the depicted content is utilized at https://regex101.com./# - is considered invalid by VSC.
Apologies if that explanation is not what you request.
Regexp101 also shows an error if you switch to ES/JS Editor's find widget uses ES/JS engine and its grammar, as mentioned above, and correctly report issue with your pattern.
PCRE is used only for global search and in you don't have file open, open files switch to JS
https://github.com/microsoft/vscode/issues/216105#issuecomment-2343057920
@IllusionMH, so I should the issue as unactionable? Would be nice if the dialogue demonstrated which engine it was using for a given operation.
code-insiders-1.91.0-1718259485.el8.rpm
cpe:/o:fedoraproject:fedora:40
Steps to Reproduce
Enter
.VCF
data containing aPHOTO
element, with aREV
element beneath it:Try to select those using
PHOTO(?s)(.*)REV
at https://regex101.com./#.This shall work.
Test it in VS Code: