I want to match every week day in a string where all words are comma separated.
Examples: "mon, thu, fry" should be matched "mon, tue, sat" should be matched "" should not be matched "mon, tue, wed, thu, fri, sat, sun" should be matched "foo, bar" should not be matched
I came up with this regex but it matches only the string containing ALL week days:
^(mon|tue|wed|thu|fri|sat|sun)$
How can I match them "indipendently"?
I am using python3
^(?:mon|tue|wed|thu|fri|sat|sun)(?:\s*,\s*(?:mon|tue|wed|thu|fri|sat|sun))*$
– anubhavamon, foo
? – Tim Biegeleisen^(mon|tue|wed|thu|fri|sat|sun)(,\s*(mon|tue|wed|thu|fri|sat|sun))*$
– Wiktor Stribiżew