What it does
A character class matches exactly one character from a set, such as [A-F0-9] for one hexadecimal digit.
How to use it
- Load the example.
- Read the class in the Explanation tab.
- Check the counterexample.
Verified example
Example
Text "AF 09 GZ"
[A-F0-9]{2} Result: "AF", "09"
[A-F0-9]{2} Result: "AF", "09"
[A-F0-9]{2} Result: "AF", "09"
[A-F0-9]{2} Result: "AF", "09"
Counterexample
Text "GZ"
[A-F0-9]{2} Result: no match
[A-F0-9]{2} Result: no match
[A-F0-9]{2} Result: no match
[A-F0-9]{2} Result: no match
Recorded by running fixture FX-S02 on : rp.js@1 on Node v24.21.0 (V8), v24.21.0, CPython 3.14.2 (Pyodide 314.0.7), PCRE2 10.48, go1.27.1. JavaScript results come from the rp.js@1 core on Node’s V8; your browser runs the same core.
Engines
- Class shorthands such as \d and \w differ in Unicode handling between engines.
Limits
- [A-F0-9] is case-sensitive; add a-f or flag i for lowercase hex.