An implicit partial differential equation (PDE) method is used to determine the cost of hedging for a Guaranteed Lifelong Withdrawal Benefit (GLWB) variable annuity contract. In the basic setting, the underlying risky asset is assumed to evolve according to geometric Brownian motion, but this is generalised to the case of a Markov regime switching process. A similarity transformation is used to reduce a pricing problem with K regimes to the solution of K coupled one dimensional PDEs, resulting in a considerable gain in computational efficiency. The methodology developed is flexible in the sense that it can calculate the cost of hedging for a variety of different withdrawal strategies by investors. Cases considered here include both optimal withdrawal strategies (i.e. strategies which generate the highest possible cost of hedging for the insurer) and sub-optimal withdrawal strategies in which the policy holder׳s decisions depend on the moneyness of the embedded options. Numerical results are presented which demonstrate the sensitivity of the cost of hedging (given the withdrawal specification) to various economic and contractual assumptions.