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

Logger always highlights first match #3037

Closed
joey04 opened this issue Sep 19, 2017 · 4 comments
Closed

Logger always highlights first match #3037

joey04 opened this issue Sep 19, 2017 · 4 comments

Comments

@joey04
Copy link

joey04 commented Sep 19, 2017

The first match is almost always the actual match, but sometimes it's not.

I saw it again here with this plain string rule that's word-boundary enforced by default:
1

(Another case for me is #3011, but that requires the change I made to enforce word-boundary for > 7 char tokens.)


update:

I wrote this addition, which finds the actual match for every case I've come across.

(I've since refined my patch to be a do-while(1) loop with a single null test, still using the exact same regex statements. Functionally, this just saves a few CPU cycles, but it's a nice aesthetic improvement.)

@joey04
Copy link
Author

joey04 commented Aug 25, 2018

Closing per #3011 (comment)

@joey04 joey04 closed this as completed Aug 25, 2018
@gorhill gorhill reopened this Aug 25, 2018
@gorhill
Copy link
Owner

gorhill commented Aug 25, 2018

I thinks its best that the logger shows the real match which occurred inside uBO.

@joey04
Copy link
Author

joey04 commented Aug 25, 2018

I agree, but are there any other cases besides the prefix1's I reported? If not, then it's a niche consideration like #3011.

gorhill added a commit that referenced this issue Jul 11, 2021
Related issue:
- #3037

This takes care of the specific case reported. There are
other edge cases which are likely not addressed though, i.e.
those involving wildcards -- those should be rather rare and
at this point I rather leave them unaddressed to not
risk regressions (as they are less trivial to address).
@gorhill
Copy link
Owner

gorhill commented Jul 11, 2021

I couldn't reproduce with the original URL provided, however I could reproduce and verify the fix using those hand-crafted URL/filter pairs:

  • http://example.org/1s.crazyclickstats.com/1/? with /1
  • http://example.org/123456s.crazyclickstats.com/123456/? with /123456
  • http://example.org/1234567s.crazyclickstats.com/1234567/? with /1234567

@gorhill gorhill closed this as completed Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants