I want my textbox in html to accept only specific format entered by user.

For example I want to enter roll number: F17-9006; F17-9007

First should be character, second and third should be numbers, a dash is automatically added, then four numbers after that and at the end semicolon is placed and then again the same for next entries.