Try piping the user input through an awk script. See "man awk" for details (the awk man pages are well written and an excellent resource). I find you can do just about anything you want using awk, including splitting a string of input into separate parts and reformatting it, and also returning an error code if a format problem is identified. I have no doubt that awk can do what you are wanting, and there is no need for a space delimiter if you use awk.
Awk is an incredibly fast, and incredibly flexible data manipulation tool that can be used for simple one liners or managing entire databases. Awk uses simple C like syntax and can do if statements, loops, subroutines, string search and substring functions, multi-dimensional arrays, scientific arithmetic functions, multiple file data reads and writes, and system calls of anything else that isn't already included in the awk structure.