FIXED: Unexpected behavior when searching folder with regular expression

Report issues, odd behaviors or submit a detailed bug report.
Post Reply
AndreasW
Posts: 57
Joined: 30 May 2017 07:22

FIXED: Unexpected behavior when searching folder with regular expression

Post by AndreasW » 09 Sep 2017 10:23

When searching through folders using the regular expression "#define.*MAX" (without the quotes), I would expect that only lines containing strings like "#define IS_MAX" are found. However, in fact, also lines containing only "#define" (without "MAX") are found.

This problem does not occur when searching only within the current file.

User avatar
Rickard Johansson
Site Admin
Posts: 5550
Joined: 19 Jul 2006 14:29

Re: Unexpected behavior when searching folder with regular expression

Post by Rickard Johansson » 16 Sep 2017 16:56

I haven't been able to reproduce this.

I've tried with files containing

#define IS_MAX
#define

the search string "#define.*MAX" seems to work just fine and only find the first statement in the files.

AndreasW
Posts: 57
Joined: 30 May 2017 07:22

Re: ??? Unexpected behavior when searching folder with regular expression

Post by AndreasW » 16 Sep 2017 19:56

I've tried to create a simple example for you to reproduce the error, but unfortunately, the error does not occur with that simple example. The error is 100% reproducible with real C++ files at work, but these files are confidential. :(

AndreasW
Posts: 57
Joined: 30 May 2017 07:22

Re: ??? Unexpected behavior when searching folder with regular expression

Post by AndreasW » 16 Sep 2017 20:14

Ok, I think I've managed to create an example with non-confidential content to reproduce the error. Unzip the file in the attachment into a folder and execute Find In Files on the folder containing that file. Search for the regular expression "#define.*MAX" (without the quotes). The file will be found, although it shouldn't be found.
Attachments
a.zip
(157 Bytes) Downloaded 29 times

User avatar
Rickard Johansson
Site Admin
Posts: 5550
Joined: 19 Jul 2006 14:29

Re: ??? Unexpected behavior when searching folder with regular expression

Post by Rickard Johansson » 17 Sep 2017 17:18

Fixed in next version. Thanks!

Post Reply