"You revile the high priest of God? Paul said: I did not know, brothers, that he was the high priest." How then did he say: "You sit to judge according to the law?" Yes, Paul pretends not to know, but this was not harmful but beneficial for the listeners. But I (Blessed Theophylact) am very convinced that Paul truly did not know that Ananias was the high priest, since Paul had arrived recently in Jerusalem, had not associated with the Jews, and saw Ananias among many other persons. Indeed, among many and various persons the high priest was also inconspicuous.
Source: Commentary on Acts