help me out with a simple regex
I am trying to write a simple regex to be used with preg_match
Basicaly trying to match a list deliminated by new lines.
The list has to have at least two items and an optional first item "none". The input is trimed so dont have to worry about leading or trailing newlines
So here are a few examples of valid lists:
none\nitem2\nitem2 , item1\nitem2 , item1\nitem2\nitem3 ...
A few examples of invalid lists:
item1 , none , none\nitem1
At first i came up with this:
But it does not work because of greediness