I have two source files: searchworker and searchvalidator. The worker provide how program will work (logically) and validator is just validate user input.
In my case, the system will run correctly if user input 9 digits of key (e.g. GGHYK1221) with no exception. If user input less or more than 9 digits it will call error message.
Actually, the key is GG-H-YK-1221. So, it doesn't match with the system spec. It should delete first hyphen (-) manually. Now, I want to allow user input max 12 digits and delete hyphen. I've done delete hyphen using regex, but I'm stuck at set input length to 9 for pass the validator. Any idea to solve this or another ways?
I using Java.
Thank you