un bel javascript lato client accopiato ad una regexp lato server ed il gioco è fatto...