I'm trying to implement the regex described on the title...here's what i have so far:
"(^\\d{1,2})+(,\\d{1,2})*$"
It works when my input is like this:
1,2,3,4,5,6,7 and so goes on
But i'd like to allow the user to add white spaces as he/she wants:
1 , 2,3,4 ,5
I know it's a bit weird but it's a flexibility i'd like to give to the final user. How can i acomplish this?
EDIT: I forgot to mention that the spaces are only allowed before or after the one or two digits;
EDIT2: I also forgot to mention that after the comma, can have white spaces too.