server/matcher.py: added backtracking support in match_all