This sounds like a homework problem. What have you already tried?
In reply to Re: reg exps by ehdonhon in thread reg exps by Anonymous Monk