If the lot number must be 7 numeric digits, what begins with 5, one more condition needsto be added.
dt = current data table();
dt<<select where(length(:Column 1) != 7 | left(:Column 1, 1) != "5" | IsMissing(num(:Column 1)));
Also, new column using a formula can find matches using Regex. Column 2 of the table displayed below, uses the formula
Regex( :Column 1, "(5\d{6}\b)", "\0" ). the selected rows are those selected by the Select Where() command above.
Note row 10, 5Z3661A, would not be selected without the additional criteria IsMissing(num(:Column 1))