Better method of soliving the problem, using regex.