It turns out I made a little mistake. The regex should be more like ^[A-Fa-f0-9]+$. The "0" problem might be sorted like this ^[A-Fa-f1-9][A-Fa-f0-9]*$.
1 min read
RE: Regex 101 Exercise S2 - Verify a string is a hex number
Paul Kinlan
Lead of Chrome DevRel
See Also
Stay in the loop.
I'm trialing a newsletter. Join for monthly insights into web dev, Chrome, and the open web.