Implement a more advanced heuristic using regex and some simple rules