I'm looking to create a regex that would match either xxx
or yyy
, or any combination separated by commas.
So these would be valid:
xxx
yyy
xxx,xxx
yyy,xxx
xxx,yyy,yyy,yyy
But these would be invalid:
xx // must be exact xxx
yyyy // must be exact yyy
xxx, // trailing comma
xxxyyy // no delimiter
xxx,,yyy // should only have one comma between
,xxx,yyy // no prepending commas