recursive isMatch