I need PCRE2 regex to find all occurences of "no" as well as first and last occurences of "yes".
Expected results:
"no/yes" - expect two matches: "no" and "yes"
"no/yes/word/yes/no" - expect four matches: "no", "yes", "yes", "no"
"yes/yes/no/word/yes" - expect three matches: first "yes", "no", third "yes"
"yes/no/yes/yes" - expect three matches: first "yes", "no", third "yes"
I try this regex but it don't work as expected with "yes/no/yes/yes".
This subtask can make me happy with main goal.