New issue
Advanced search Search tips

Issue 693594 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Feb 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Search in files is returning results different than the ones searched for

Reported by raphael...@gmail.com, Feb 17 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce the problem:
1. Open DevTools
2. Cmd+Option+F to open "Search in Files"
3. Try to search for "|" (quotes included)
4. You might or might not check ignore case, but leave Regular expression OFF
5. Do the search
6. Notice that instead of search results only show the string you searched for, it shows every single pipe character

What is the expected behavior?
That the search in files with regular expression off should search for the EXACT string that's been entered by the user. 

What went wrong?
The string is somehow modified and quotes are being ignored, even though regular expression is off. Example:

I'm trying to find a code like the following: alert( var1 + "|" + var2 );

But by searching quote pipe quote ("|") I get every single pipe in all files, which is wrong. If I wanted every single pipe, I'd search for | only.

I could only manage to search what I wanted with a regular expression ("|')[\|]("|'). I'm forced into a regular expression or by escaping the quotes, like \"|\" which is wrong. As PhistucK mentioned in the discussion forum, searching for "var issue" (unquoted) does not yield results (lines?) that have var and issue (which are not necessarily "var issue").

if we don't have regular expression checked, search should've been a simple "find this string".

Did this work before? N/A 

Chrome version: 58.0.3015.0 canary (64-bit)  Channel: canary
OS Version: OS X 10.12.2
Flash Version: Shockwave Flash 24.0 r0

Discussion @ https://groups.google.com/forum/#!topic/google-chrome-developer-tools/MoHkB_clpmY

 
quotepipe_search.png
30.5 KB View Download
Labels: OS-Windows

Comment 2 by allada@chromium.org, Feb 17 2017

Status: WontFix (was: Unconfirmed)
Thanks for the report!

This is working as intended. This is because we allow things like `foo -f:somefile.js` which will find "foo" in any file but not in any file matching "somefile.js". We believe users would be inclined to just add double quotes around it if they actually wanted to search for one of this kind of string instead of doing an advanced search query.

see this comment: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/devtools/front_end/workspace/SearchConfig.js?l=61

Sign in to add a comment