Make regex stricter and remove some subsequent checks