After choosing to bat on a slow, turning pitch, the visitors closed on 182 for 8 with Gregory unbeaten on 60 from 93 balls, having supervised an impressive recovery from a parlous 82 for 7.
His work meant that this crucial match between the two sides currently straddling the Division One relegation line ended a truncated first day, in which 40 overs were lost to rain and bad light, pretty much even.
The game opened with a compelling tussle as Siraj bowled to Imam-ul-Haq, who edged a waft to wicketkeeper Michael Burgess. Olly Hannon-Dalby then hit Tom Abell’s off stump with the second ball after a rain-enforced early lunch.
Tom Lammonby and George Bartlett took Somerset to 46 for 2 before three wickets fell in six balls to leave them 46 for 5. Lammonby’s ill-advised charge at debutant Jayant Nadav saw him comfortably stumped, then Bartlett gloved a pull at Siraj and James Rew fell lbw first ball.
After Siraj went off to graze with figures of 13-5-25-3, Henry Brookes maintained the pressure with two wickets in his first four overs as Lewis Goldsworthy and Kasey Aldridge were lbw to rapid inswingers.
Somerset were in deep trouble at 82 for 7 but Gregory played with great vigilance, interspersed with one spectacular burst of aggression when he lifted Danny Briggs for three successive sixes just before tea.
In the final session, Gregory and Davey added 58 in 14 overs before Siraj won another lbw decision to oust Davey. Warwickshire’s hopes of briskly lopping off the tail were foiled by Gregory’s continued doggedness with assertive support from Khan, who was 31 not out from 33 balls at the close.