This circuit shows how a transistor voltage regulator functions. With voltage regulators the input voltage is not one fixed value, for example 12 V. but can vary between 12 and 30 V. In the scenario of this circuit, the voltage regulator limits the output voltage to 12 V.
Also these can be used for AC current.
In this circuit, a choice can be made between AC and DC current with multiple voltages. The current will flow through a full wave bridge rectifier and then through the transistor regulator.
When the input voltage is going below 12 V. the output voltage will drop also.