"Have you got a good heatsink on the LM317? " - No kidding !!
If there wasn't a concern for galvanic isolation, I would almost lean towards a gated regulator. When the AC is below a certain threshold voltage a transistor allows the full mains to enter, anything above is blocked. Sorry, I don't know the correct terminology for this type of regulator, but I have designed and tested such a regulator from 24VAC to 290VAC input with a variac transformer and it worked great for the application. With a rectified sine wave the output voltage looks like an "M" on a scope where the peak of the M is at the Zener voltage and the bottom of the M is 0V.