This might be more reliable as a single regex that matches the newlines and anchors the beginning and end.