I need to check whether a string matches the following logical pattern:
string, string, string
I NEED TO USE A REGEXP and I cannot use functions.
For example the following string should match:
hello,hola, ciao,bye -> [hello,hola,ciao,bye]
The following shouldn't match:
hello -> []
I'm using this regexp right now but it's working fine only for the first string. I'm trying to exclude the single string without a comma in the second example.
([^,]+)
The following regexp doesn't work neither: isn't it supposed to match every group and then the end of the line BUT before the end of the line a comma followed by a string must be present?
([^,]+)(?<=,)$
Any ideas?