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

fix incorrect regular expressions for uint base types #605

Merged
merged 4 commits into from
Dec 18, 2024

Conversation

PelleKrab
Copy link
Contributor

Closes #556.

The issue with the suggested update to the regex ^0x([1-9a-f][0-9a-f]{0,63})|0$ was that it allowed 0xanything0 to be valid. This issue also exists in the current implementation, which is why the test "works fine," as @fvictorio mentioned. My updated regex addresses all the problems mentioned in the issue and fixes the |0 edge case.

My proposed regex:

^0x(([1-9a-f][0-9a-f]{0,63})|0{1,64})$

@fjl fjl changed the title Fixed incorrect regex fix incorrect regular expressions for uint base types Dec 18, 2024
@fjl fjl merged commit 28e82b4 into ethereum:main Dec 18, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

Is the pattern for "hex encoded 256 bit unsigned integer" correct?
2 participants