Probing the extended gaseous regions of M31 with quasar absorption lines