brute force solution for RE match done