Is there any elegant solution to build a variable length look-behind regex such as this one ?
/(?<=eat_(apple|pear|orange)_)today|yesterday/g;
How about:
(?:(?<=eat_apple_)|(?<=eat_pear_)|(?<=eat_orange_))(today|yesterday)
A little bit uggly, but it works.