R - restrict user input with readline and regex