adds regex method to solve problem