updated regex to optimal form