From BiblePortal Wikipedia

Watson's Biblical & Theological Dictionary [1]

or Teachers, of the law, a class of men in great repute among the Jews. They had studied the law of Moses in its various branches, and the numerous interpretations which had been grafted upon it in later times; and, on various occasions, they gave their opinion on cases referred to them for advice. Nicodemus, himself a doctor (διδασκαλος , teacher ) of the, law, comes to consult Jesus, whom he compliments in the same terms as he was accustomed to receive from his scholars: "Rabbi, we know that thou art διδασκαλος , a competent teacher from God."

Doctors of the law were chiefly of the sect of the Pharisees; but they are sometimes distinguished from that sect,  Luke 5:17 .

Morrish Bible Dictionary [2]

Literally Teachers: otherwise called Doctors Or Teachers Of The Law. Those who devoted themselves to the study and teaching of the Jewish law.  Luke 2:46;  Luke 5:17;  Acts 5:34 .