A user enters his/her number of credit hours per course in my UITextField in this format....
4,3,4,3,3
(4 credit hours for 1st course, 3 credit hours for 2nd course, so on)
Conditions: The user can only enter in MIN of 1 course and MAX 5 courses, the credit hours must be separated by a comma except for the last one, the string should contain only numbers and commas (no letters etc.) in that order.
I am trying to display an error message if conditions are violated. I think I will need to create a regExp. I am not sure how to create one since the user can enter in 2 courses so... (3,4) and still be okay. (like it cant follow a strict format like phone number).