in reply to The instance/type of a variable

The date is year-julian. One last question: If I would like to allow the following formats:
2005-111 2005111 2005
Somehow this doesn't work:
$a = $some_date ; if ( $a =~ /\d{4}-?\d{3}?/ ) { .... }
Any suggestions why this doesn't work ?
Thanks a lot
Luca