Menu

#99 Possible bug: RegEx won't match

v4.4.5
wont-fix
None
3
2024-05-16
2017-07-04
exalted
No

For the string Foo<Bar, IEnumerable<Baz>>, the regex foo.*ienum won't match. Any ideas why?

  • non case sensitive
  • not whole word

Discussion

  • Jackslade

    Jackslade - 2017-07-05

    I created a test file with this string in it and then performed a search using your regular express and got the correct result.

    Is it possible for you to send me the log file (Help -> Log File) after you have tried this search? It might also be helpful to send an example file that has those contents if possible.

    Thanks,
    Curtis

     
  • exalted

    exalted - 2017-07-06

    I am surprised you weren't able to replicate it.

    You can find test.txt file that I used as an attachment to this message.

    What's in the log file is below (it is also attached):

    2017-07-06 13:09:11.8120|Info|AstroGrep.Windows.Forms.frmMain.frmMain_Closed|### STOPPING AstroGrep, version 4.4.6 ###
    2017-07-06 13:09:13.2127|Info|AstroGrep.Windows.Program.Main|### STARTING AstroGrep, version 4.4.6 ###
    2017-07-06 13:09:13.2746|Info|AstroGrep.Windows.Program.Main|Operating System: Microsoft Windows NT 6.2.9200.0
    2017-07-06 13:09:13.2934|Info|AstroGrep.Windows.Program.Main|Displaying main search window.
    2017-07-06 13:09:25.7593|Info|libAstroGrep.EncodingDetection.Caching.EncodingCache.Load|Loading encoding cache from disk at C:\Users\a.donmez\AppData\Roaming\AstroGrep\Cache\encodings_Default.cache
    2017-07-06 13:09:25.7593|Info|libAstroGrep.EncodingDetection.Caching.EncodingCache.Load|Encoding cache loaded successfully with 43 items
    2017-07-06 13:09:25.7832|Info|AstroGrep.Windows.Forms.frmMain.LogStartSearchMessage|Search started in 'C:\Users\a.donmez\Desktop'[include sub folders] against test.txt[detect encoding, performance set at default, cache enabled] for foo.*ienum[regex, 3 context lines]
    2017-07-06 13:09:25.8048|Info|AstroGrep.Windows.Forms.frmMain.LogStopSearchMessage|Search stopped (finished), taking 0,0259398136110465 seconds.
    2017-07-06 13:09:25.8360|Info|libAstroGrep.EncodingDetection.Caching.EncodingCache.Save|Saving encoding cache [43 items] to disk at C:\Users\a.donmez\AppData\Roaming\AstroGrep\Cache\encodings_Default.cache
    

    Also, if instead of foo.*ienum you search for foo.*enum (notice the missing 'i'), it will match. (I noticed this behavior first in Visual Studio's search function, then replicated with AstroGrep. I suspect it's something about the .NET regex engine.)

    Weird, isn'it it?

     
  • Jackslade

    Jackslade - 2017-07-06

    Interesting, I still can't replicate your issue, even using your test file. I'm wondering if you have an exclusion set that is excluding this file for some reason? You should be able to check the exclusion messages by selecting View -> Exclusion Messages after a search.

    Also, I'm not sure if this is an issue with this, but what is your language set to on the os level? I noticed the time display in the log has a comma, perhaps something with a different language is causing an issue.

    It looks like we are both running Win 10 as well, so not exactly sure the difference. Perhaps you can also upload your *.config files from the %appdata%\astrogrep folder.

    Thanks for taking the time to work this out with me.
    Curtis

     
  • exalted

    exalted - 2017-07-07

    Interesting, I still can't replicate your issue, even using your test file. I'm wondering if you have an exclusion set that is excluding this file for some reason? You should be able to check the exclusion messages by selecting View -> Exclusion Messages after a search.

    I think it's not related to exclusion set. I say that because, same file will match if you search for foo.*enum (notice the missing 'i') instead of foo.*ienum.

    Regardless, after I did the search, View > Exclusion Messages is disabled. Instead this is the screenshot for View > All Messages:

    Also, I'm not sure if this is an issue with this, but what is your language set to on the os level? I noticed the time display in the log has a comma, perhaps something with a different language is causing an issue.

    Below are OS language settings & regional settings for date/time/number formats:


    It looks like we are both running Win 10 as well, so not exactly sure the difference. Perhaps you can also upload your *.config files from the %appdata%\astrogrep folder.

    Sure, you can find AstroGrepConfigs.zip as an attachment to this message.

    Let me know if I can help in any other way.

    Cheers!

     

    Last edit: exalted 2017-07-07
  • Jackslade

    Jackslade - 2024-02-16

    Can't seem to reproduce on the latest version (setting to pending unless I can find the cause).

     
  • Jackslade

    Jackslade - 2024-02-16
    • status: open --> pending
    • assigned_to: Jackslade
    • Priority: 1 --> 3
     
  • Jackslade

    Jackslade - 2024-05-16
    • status: pending --> wont-fix
     
  • Jackslade

    Jackslade - 2024-05-16

    Unable to reproduce with the specific version and future versions.

     

Anonymous
Anonymous

Add attachments
Cancel