1 min read

RE: Regex 101 Exercise S2 - Verify a string is a hex number

Paul Kinlan

Paul Kinlan

Lead of Chrome DevRel

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]*$.

Stay in the loop.

I'm trialing a newsletter. Join for monthly insights into web dev, Chrome, and the open web.

alternate_email

Get in touch

Open to chat about Chrome or Web development.

Book a consultation