Regex Lab
Learn regular expressions by doing. Each puzzle gives you strings that should match and strings that should not — write one pattern that gets them all right to advance. Hints included when you get stuck.
Digits only
Match strings that are made up of digits only.
//
Should match
·0
·42
·2024
·007
Should not match
·12a
·abc
·(empty string)
·3.14
Make every row green to solve.
Runs entirely in your browser — your data never leaves this page.