updated regex matching