Thanks all for taking the time to describe these requirements.
I recommend checking Studio Web where one can test expressions directly from Expression Editor.