Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28339
    Jon Grah
    Participant

    I was doing a regex search
    (?:[A-Z]{2}),0,.*$
    And I got some matches like this

    `
    2019-01-14,04:00,UK,2,LME Copper Inventories,0,,100,,109664
    2019-01-22,04:00,UK,2,LME Copper Inventories,0,,9925,,109676
    2019-03-10,03:00,CA,0,Daylight Saving Time Shift,,,,,99633
    2019-03-10,03:00,US,0,Daylight Saving Time Shift,,,,,99628
    2019-03-30,21:00,EZ,0,Daylight Saving Time Shift,,,,,99639
    2019-03-30,21:00,SZ,0,Daylight Saving Time Shift,,,,,99640
    2019-03-30,21:00,UK,0,Daylight Saving Time Shift,,,,,99636
    2019-04-01,04:00,UK,2,LME Copper Inventories,0,,-1425,,109766
    2019-04-06,10:00,NZ,0,Daylight Saving Time Shift,,,,,103783
    2019-04-06,12:00,AU,0,Daylight Saving Time Shift,,,,,103782
    2019-09-28,10:00,NZ,0,Daylight Saving Time Shift,,,,,103788
    2019-10-05,12:00,AU,0,Daylight Saving Time Shift,,,,,103785
    2019-10-26,22:00,EZ,0,Daylight Saving Time Shift,,,,,99645
    2019-10-26,22:00,SZ,0,Daylight Saving Time Shift,,,,,99642
    2019-10-26,22:00,UK,0,Daylight Saving Time Shift,,,,,99644
    2019-11-03,02:00,CA,0,Daylight Saving Time Shift,,,,,99631
    2019-11-03,02:00,US,0,Daylight Saving Time Shift,,,,,99629
    2020-03-08,03:00,CA,0,Daylight Saving Time Shift,,,,,110757
    2020-03-08,03:00,US,0,Daylight Saving Time Shift,,,,,110756
    2020-03-28,21:00,EZ,0,Daylight Saving Time Shift,,,,,110761
    2020-03-28,21:00,SZ,0,Daylight Saving Time Shift,,,,,110762
    2020-03-28,21:00,UK,0,Daylight Saving Time Shift,,,,,110760
    2020-04-04,10:00,NZ,0,Daylight Saving Time Shift,,,,,113617
    2020-04-04,12:00,AU,0,Daylight Saving Time Shift,,,,,113812
    2020-06-23,09:59,US,1,Richmond Manufacturing Index,0,-3,-27,,113876
    2020-09-26,10:00,NZ,0,Daylight Saving Time Shift,,,,,113618
    `
    and I extracted the matches to be sure.

    Highlighted portion would be
    `
    es,0,,100,,109664
    es,0,,9925,,109676
    CA,0,Daylight Saving Time Shift,,,,,99633
    US,0,Daylight Saving Time Shift,,,,,99628

    es,0,,-1425,,109766

    ex,0,-3,-27,,113876
    `


    Then I added some “flags”, specifically the case sensitive flag (?i) and (?-i)

    (?-i)(?:[A-Z]{2})(?i),0,.*$

    and then press “select all” button like I always do, to see the match count and highlights

    The correct matches are

    `
    2019-03-10,03:00,CA,0,Daylight Saving Time Shift,,,,,99633
    2019-03-10,03:00,US,0,Daylight Saving Time Shift,,,,,99628
    2019-03-30,21:00,EZ,0,Daylight Saving Time Shift,,,,,99639
    2019-03-30,21:00,SZ,0,Daylight Saving Time Shift,,,,,99640
    2019-03-30,21:00,UK,0,Daylight Saving Time Shift,,,,,99636
    2019-04-06,10:00,NZ,0,Daylight Saving Time Shift,,,,,103783
    2019-04-06,12:00,AU,0,Daylight Saving Time Shift,,,,,103782
    2019-09-28,10:00,NZ,0,Daylight Saving Time Shift,,,,,103788
    2019-10-05,12:00,AU,0,Daylight Saving Time Shift,,,,,103785
    2019-10-26,22:00,EZ,0,Daylight Saving Time Shift,,,,,99645
    2019-10-26,22:00,SZ,0,Daylight Saving Time Shift,,,,,99642
    2019-10-26,22:00,UK,0,Daylight Saving Time Shift,,,,,99644
    2019-11-03,02:00,CA,0,Daylight Saving Time Shift,,,,,99631
    2019-11-03,02:00,US,0,Daylight Saving Time Shift,,,,,99629
    2020-03-08,03:00,CA,0,Daylight Saving Time Shift,,,,,110757
    2020-03-08,03:00,US,0,Daylight Saving Time Shift,,,,,110756
    2020-03-28,21:00,EZ,0,Daylight Saving Time Shift,,,,,110761
    2020-03-28,21:00,SZ,0,Daylight Saving Time Shift,,,,,110762
    2020-03-28,21:00,UK,0,Daylight Saving Time Shift,,,,,110760
    2020-04-04,10:00,NZ,0,Daylight Saving Time Shift,,,,,113617
    2020-04-04,12:00,AU,0,Daylight Saving Time Shift,,,,,113812
    2020-09-26,10:00,NZ,0,Daylight Saving Time Shift,,,,,113618
    `

    highlighted portion should only be

    `
    CA,0,Daylight Saving Time Shift,,,,,99633
    US,0,Daylight Saving Time Shift,,,,,99628

    `

    **But the incorrect matches were still highlighted, even though they were NOT selected**. And I can confirm when the extraction was done, only the rows that had a correct match were extracted.

    I tried to Erase Find Highlight and do the search again. And I can confirm the search still highlights incorrect search portions in the full document. This makes no sense. What logic is the highlighter using to highlight text that would not even match?

    I suspect that the highlighter is not respecting certain regex flags…which is weird as the highlighter should be following the same logic as the selector, isn’t it?

    I can produce a screen video if you don’t believe me.

    #28340
    Yutaka Emura
    Keymaster

    Can you please simplify your sample and steps, and make a minimum reproducible test case? If you could find a minimum reproducible test case, please share with me either by email, or post here with “code” format. Thank you.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.