#!/usr/bin/pugs use v6; rule minute { <[1..5]>?\d | <[*]> }; rule hour { <[1..2]>?\d | <[*]> }; rule day { 31 | 30 | <[1..2]>?\d | <[*]> } rule month { 1?\d | <[*]> } rule day_of_week { <[0..6]> | <[*]> } rule crontab { \s+ \s+ \s+ \s+ } my $crontab = "0 10 * * *" ~~ //; my $match = $crontab; say "Minute: $match\nHour: $match\n" ~ "Day: $match\nMonth: $match\n" ~ "Day of Week: $match";