Skip to content

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