I am trying to set the max string length between commas to 4.
I am using ^([^,?]{0,4},)*[^,?]{0,4}$
, which works fine. However if the user adds a space before the word, the current code counts that whitespace.
Example: 'this','will','be','fine'. <-- this works.
'this',' will','not','work' <-- this does Not work. Notice the whitespace before the ' will'. How do I modify my regex to not count this whitespace?