Improve "match" handling: config and escaping