Skip to content
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

A small problem in regex finding #41805

Closed
FishyFizz opened this issue Jan 18, 2018 · 6 comments
Closed

A small problem in regex finding #41805

FishyFizz opened this issue Jan 18, 2018 · 6 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) search Search widget and operation issues

Comments

@FishyFizz
Copy link

FishyFizz commented Jan 18, 2018

  • VSCode Version: Code 1.19.2 (490ef76, 2018-01-10T16:16:25.767Z)
  • OS Version: Windows_NT ia32 10.0.15063
  • Extensions:
Extension Author (truncated) Version
lua-debug act 0.1.2
vscode-great-icons emm 2.1.22
cpptools ms- 0.14.6
team ms- 1.122.0
vscode-lua tri 0.9.0

(2 theme extensions excluded)


Steps to Reproduce:

1.Text in editor is shown below

	e1:SetCode(EFFECT_UPDATE_ATTACK)
	e1:SetValue(e:GetLabel())
	e1:SetReset(RESET_EVENT+0x1ff0000)

2.The regex which would have matched it is shown below but it missed the hit
.SetCode.(\n.*){0,3}SetReset
two asterisks were invisible but made "SetCode" italic. (Markdown Styling)

(The regex pattern worked well with notepad++ and regex101.com)

Update:
I found the results matching the pattern with notepad++. And it matched in VSCode after I opend a file containing one of the results(yeah it only found this one). And it matched two when two editor windows stayed open...
Possible to make it search the whole workspace just like what it does for the regex patterns without "\n"?

Reproduces without extensions: Yes

@vscodebot vscodebot bot added editor editor-find Editor find operations labels Jan 18, 2018
@usernamehw
Copy link
Contributor

You can put as many * as you want if you wrap the code into backticks (`)
.*SetCode.*(\n.*){0,3}SetReset

@usernamehw
Copy link
Contributor

usernamehw commented Jan 18, 2018

What exactly wrong with it? I'm not often using them, looks like working to me:
regex

⬆️ From a find widget Ctrl+F, Not global search

@FishyFizz
Copy link
Author

FishyFizz commented Jan 25, 2018 via email

@juler69
Copy link

juler69 commented Jan 30, 2018

I have experienced the same problems with regex searches, mostly when using Find in Folders.
I frequently either:

  • cannot find things that should match
  • can only find the first instance of a match
  • find a small subset of matches and miss the rest

If I repeat the search using Find in a single open file it usually works.
Sometimes when I get right out of any files in the folder I am searching and repeat the search it works where it didn't previously if the folder was expanded.

@alexdima
Copy link
Member

Given a file with the contents:

	e1:SetCode(EFFECT_UPDATE_ATTACK)
	e1:SetValue(e:GetLabel())
	e1:SetReset(RESET_EVENT+0x1ff0000)

And a regex search for .*SetCode.*(\n.*){0,3}SetReset, the find in file search gives one hit:

image

When the file is closed (and we use rg for searching), the match is indeed not found:
image

I am not sure if we ever implemented multi-line search when searching across files

@alexdima alexdima added search Search widget and operation issues and removed editor editor-find Editor find operations labels Jan 31, 2018
@alexdima alexdima assigned roblourens and unassigned alexdima Jan 31, 2018
@roblourens
Copy link
Member

No, we don't support multiline search across files. #13155

@roblourens roblourens added the *duplicate Issue identified as a duplicate of another issue(s) label Jan 31, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests

5 participants