I've seen older/similar posts so I thought I'd refresh it.
and add the things I know from working on HVAC systems.
I am working on a project that powers off an HVAC system.
the transformer in the HVAC is rated to turn 230Vc into 24Vac
unfortunately the power companies pull a little trick to save themselves money.
the input voltage is 248Vac which puts the transformer output at 28Vac.
24V rectified will easily fall below the 36V max on normal regulators.
28V rectified ends up rectifing to about 40V. even at 1/2 wave I end up over 36V.
result: my LM7812 overheats even at idle with a heat sink.
(my project has 12V components I have to use.)
The peak voltage of the mains depends on the rms voltage but also on the amount of
harmonics on the supply, which these days can be large due to lots of SMPS's, or in
an industrial setting from motor-driving circuitry.
You cannot rely on 24Vac transformer secondary output peaking at 34V, you should
expect harmonics and noise on the mains, so 40V wouldn't surprise me at all. 100V spikes
quite likely too (fluorescent lighting and fridge motors generate spikes for instance),
but those wouldn't be energetic enough to affect a smoothing capacitor much, its
just the rectifier diodes that need to survive those.
Also an unloaded transformer secondary typically generates 10% higher voltage than
at full load, so unless the transformer is matched to the load the voltage can be
10% out anyway.