Is there any elegant solution to build a variable length look-behind regex such as this one ?
/(?<=eat_(apple|pear|orange)_)today|yesterday/g;
Alternative solution - reverse the string and use lookahead instead. It may look ugly having to write the pattern words in reverse but it's an option when everything else fails.