There are standard available regulators. 12V,9V and 5V. Have you ever analyzed what you might need to generate a voltage regulation of say 12.7 V , 13.4 v ? or say 5.7V , 6.4 V ?Do you see some similarity? i think you do. They are increasing in steps of 0.7 .
Well the technique to do that is as given in the image below:
For the time being lets forget the capacitors . The only other thing left in the circuit are the 7812 IC and the diodes . What you might wonder is a 7812 regulates the input voltage of 16-20 volts to 12 V . But the circuit here shows 13.8V . How to you account for that?
well is like this , The base or the middle pin drains through the two diodes dropping a voltage equivalent to their forward bias junction voltage. Since by applying standard voltage addition law you can add the voltages of the two forward biased diodes and the regulated voltage.
Slight math will give you : 12 + .7 + .7 = 13.4 . Here the diodes i assume give a forward junction voltage of 0.9V . Thus giving 1.8 V extra.
But the concept remains the same. The circuit shows IN4148 . Do check the forward bias junction voltage and tally the equation. But if you take a IN4007 Standard diode it will give you 13.4 in such a configuration.
You may regulate variable voltages in this method.