If we have access to JavaScript expressions
then all you need is to pass the Green characters
to the REGEX and replace the others with dots and the Yellow character
with either brackets or vertical bars.
Example: with oc in correct positions and s available in the word you will have the expression as
(s|.)oc(s|.)(s|[^,])
Which should get you all words having oc as second and third characters and includes s anywhere in the word of 5 characters when searching through the list of possible words delimited by a comma.
Sample output