define a pattern match function for joxa