Add 'match' option to allow pattern-matching on returned values