in reply to pattern matching
Here's a Perl6 regex to do the matching.
After the match, $day will be bound to what was captured in $1, and you can proceed to appending suffixes as mentioned above by tachyon. I much like the method using the ternary operator.### <Perl6> $source =~ / $day:=(\d<1,2>) <[-/]> (\d<1,2>) <[-/]> (\d<2,4>) /; ### </Perl6>
On a side note, why are you using the /g modifier in your match? I can't see any purpose that it serves.
kelan
Perl6 Grammar Student
|
|---|