Have you tried using regex?
uses
...
System.RegularExpressions;
...
try
...
// some database function
except
on E: EFDDBEngineException do
begin
ShowMessage(TRegEx.Replace(E.Message, '\[[^\]]*\]', ''));
end;
on E: Exception do
begin
ShowMessage('An unexpected error occurred: ' + E.Message);
end;
end;