The present disclosure relates to 2-arylamino pyridine, pyrimidine, or triazine derivatives, and the preparation method and use thereof. The 2-arylamino pyridine, pyrimidine, or triazine derivatives may act on certain mutated forms of epidermal growth factor receptor, for example the L858R activating mutant, the delE746_A750 mutant, the Exonl9 deletion activating mutant, and the T790M resistance mutant, so as to be used for treatment and prevention of diseases and medical conditions. The 2-arylamino pyridine, pyrimidine, or triazine derivatives may be used for treatment and prevention of cancer. The present disclosure also relates to a pharmaceutical composition comprising 2-arylamino pyridine, pyrimidine, or triazine derivatives, intermediates useful in the manufacture of 2-arylamino pyridine, pyrimidine, or triazine derivatives, and to methods of treatment of diseases mediated by various different forms of EGFR using 2-arylamino pyridine, pyrimidine, or triazine derivatives.