We present a comprehensive study of star-forming ( SF ) regions in the nearest large spiral galaxy M31 . We use GALEX far-UV ( 1344-1786 Å , FUV ) and near-UV ( 1771-2831 Å , NUV ) imaging to detect young massive stars and trace the recent star formation across the galaxy . The FUV and NUV flux measurements of the SF regions , combined with ground-based data for estimating the reddening by interstellar dust from the massive stars they contain , are used to derive their ages and masses . The GALEX imaging , combining deep sensitivity and coverage of the entire galaxy , provides a complete picture of the recent star formation in M31 and its variation with environment throughout the galaxy . The FUV and NUV measurements are sensitive to detect stellar populations younger than a few hundred Myrs . We detected 894 SF regions , with size \geq 1600 pc ^ { 2 } above an average FUV flux limit of \sim 26 ABmag arcsecond ^ { -2 } , over the whole 26 kpc ( radius ) galaxy disk . We derive the star-formation history of M31 within this time span . The star formation rate ( SFR ) from the youngest UV sources ( age \leq 10 Myr ) is comparable to that derived from H \alpha , as expected . We show the dependence of the results on the assumed metallicity . When star formation detected from IR measurements of the heated dust is added to the UV-measured star formation ( from the unobscured populations ) in the recent few Myrs , we find the SFR has slightly decreased in recent epochs , with a possible peak between 10 and 100 Myrs , and an average value of SFR \sim 0.6 or 0.7 M _ { \sun } yr ^ { -1 } ( for metallicity Z=0.02 or 0.05 respectively ) over the last 400 Myrs .