I have a problem where the user can input any number of (x,y) co-ordinates within parentheses. For example,
User A can input (1,1) (1,2) (1,3)
User B : (1,1)
User C : (3,2) (5,5) (6,1)
I want a generic pattern matching to check if the input entered by the user is valid. Input is valid only if it follows the above format. That is, (x,y)\s(a,b)\s(c,d). I am new to regex matching and I tried like (\\(\d,\d\\)\s){1,}. This does not seem to work. Also, space should not be there after the last co-ordinate entry. Can someone help me how to get this?
Thanks in advance.