TsSearchEngine.Matches() error raised on empty cells with FPC V3.2.0 lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- russeld · 2021-04-07 09:07 Hi, With FPC V3.0.4 a worksheet could be searched without problems using regular expressions. Function TRegExpr.ExecPrim() in unit RegExpr.pas used to throw an 'empty input string' error if the string wasn't assigned, however with changes to package regexpr in V3.2.0, the error is raised if the string is empty. As most cells in a worksheet are empty, it is inevitable that this error is raised. A check in TsSearchEngine.Matches() fixes this problem. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function TsSearchEngine.Matches(AWorksheet: TsWorksheet; ARow, ACol: Cardinal): Boolean;var  cell: PCell;  txt: String;begin  cell := AWorksheet.FindCell(ARow, ACol);  txt := '';  if cell <> nil then  begin    if (soSearchInComment in FSearchParams.Options) then      txt := AWorksheet.ReadComment(cell)    else      txt := AWorksheet.ReadAsText(cell);  end;   //--- Check added for empty string  if txt.IsEmpty then    exit(false);  //---   if soRegularExpr in FSearchParams.Options then    Result := FRegEx.Exec(txt)  else  begin    if not (soMatchCase in FSearchParams.Options) then      txt := UTF8Lowercase(txt);    if soCompareEntireCell in FSearchParams.Options then      exit(txt = FSearchText);    if pos(FSearchText, txt) > 0 then      exit(true);    Result := false;  end;end; ---------------------------------------------------------------------- Bart · 2021-04-07 11:28 IIRC then this is fixed in 3.2.2 ("soon" to be released). Bart ---------------------------------------------------------------------- wp · 2021-04-09 20:15 Applied the fix in fpspreadsheet trunk. Thank you.