This formula splits the text in cell A2 into lines, filters out the lines that are exactly 10 characters long, and then returns the first line that meets this condition.
This has come in handy for filtering out specific PO's from a cell that contains multiple and includes line breaks.
=INDEX(FILTER(TEXTSPLIT(A2, CHAR(10)), LEN(TEXTSPLIT(A2, CHAR(10))) = 10), 1)