Repeated group: dotted numbers
A regex exercise from Regexdrill. Solve it with a pattern box with live highlighting in your browser, checked against hidden test strings, and it is checked the moment you submit.
The task
The whole line must match. Match one or more numbers separated by single dots, like 1, 1.2 or 10.0.3. No leading, trailing or doubled dots.
What this exercise teaches
\d+(?:\.\d+)* takes a number and then any count of dot-number pairs, so every dot sits between two numbers.
A hint if you get stuck
Match the first number, then repeat a group made of a dot and a number.
This exercise is part of Pro
Pro unlocks all 52 exercises, with worked solutions and progress saved to your account. The free exercises work without an account.
You create a free account first, so Pro is attached to it.
Monthly is charged today and then every month until you cancel, in one click from your account page. Lifetime is one payment with no renewals. Full refund within 14 days of paying.