Added string matching function.

This is a single commit from my https://github.com/johnhaddon/gaffer/tree/boxUI branch. That branch is going to take a little longer to come to fruition, and in the meantime I could use this addition in some work work I'm doing in parallel. It'd be mighty handy if we could merge this one today...