Hello.

I am Paul Kinlan.

A Developer Advocate for Chrome and the Open Web at Google.

I love the web. The web should allow anyone to access any experience that they need without the need for native install or content walled garden.

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

Paul Kinlan

In a previous post about verifying a hex number string with regex, there was a slight error. The regex should have been ^[A-Fa-f0-9]+$. A further refinement to prevent leading zeros (except for the number zero itself) would look like this: ^[A-Fa-f1-9][A-Fa-f0-9]*$.

Read More