The exponential transformation is an efficient technique for the accurate numerical evaluation of nearly singular integrals which arise in the boundary element method (BEM). It was shown that this transformation could improve the accuracy of evaluating such integrals by several orders of magnitude. Here, this transformation is extended in a more flexible fashion to allow the evaluation of nearly singular integrals which arise in general anisotropic BEM formulation, with a high degree of accuracy. A major advantage of the new method is its ease of implementation and applicability to a wide class of integrals. Three benchmark test integrals, ranging from nearly weakly, nearly strongly and nearly hyper-strongly singular integrals, are well studied to demonstrate the accuracy and efficiency of the proposed method.