less code by using regex