-
Notifications
You must be signed in to change notification settings - Fork 150
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
Regex not working as expected: last 7 characters are not matching #81
Comments
Most of this has been answered in #5:
The last 3 bytes, or the last 5 base32 characters, are not calculated until the filtering is completed so you cannot filter based off of them. The regex As for your issue about replacing one char in the matching string, if you're referring to any of the last 5 chars, again that's expected for the reasons already mentioned. The 50th character also seems not to match the filter sometimes and I do not have an explanation for that, but that probably deserves its own github issue. |
Ok, thank you for answering!30.06.2022, 00:35, "scribblemaniac" ***@***.***>:
Most of this has been answered in #5:
matching of end of onion address is not supported because of performance optimization.
at the end of address, checksum is stored, and it's SHA3 so computing it before checking would slow down cases where checking of end of address isn't needed.
regex filter you mentioned doesn't end with $ therefore only smallest portion (2 first characters) are matched.
they all end with d because of constant version byte which is included in all v3 addresses (specification, [ONIONADDRESS] section).
The last 3 bytes, or the last 5 base32 characters, are not calculated until the filtering is completed so you cannot filter based off of them.
The regex $ character does work. There is an implicit ^ at the start of every regex query, so if you want to use $ as well, it needs to be a full match. Ex: .*nyan.{2}$.
As for your issue about replacing one char in the matching string, if you're referring to any of the last 5 chars, again that's expected for the reasons already mentioned. The 50th character also seems not to match the filter sometimes and I do not have an explanation for that, but that probably deserves it's own github issue.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hello. First of all I would like to thank you for your work and adding regex. But it seems I can't match last 7 characters in onion address (before .onion).
This example works:
But when you try to add characters after that and match last 4 chars, it just can't find it:
I noticed that all addresses has "d" in end, so I tried matching character before it:
Not working :(
Also why is there no "$" to match end of string?
And why sometimes it replaces one char in matching string?
The text was updated successfully, but these errors were encountered: