My attempt at designing a voltage regulator - will this work?
Since you're going from ~18 volts to ~ 4 volts, this should more or less work as a voltage regulator. In this role,

1) Change C2 to 0.1 uF - the LM7815 specifies operation at this output capacitance, and 200 uF may well cause it to oscillate. Better yet, try just the LM1815 with the 200 uF cap (not the rest of the circuit) and see what happens. I presume you don't have a scope to look at the circuit, but at a minimum get a cheap DMM. Just be aware that any voltage you see that is not rock-steady is probably undergoing high-frequency weirdness that you can't see directly with a meter. Plus, if you do see what appears to be random drift, quickly touch the part. If you burn your fingertip, you know you need to turn off the power.

2) You don't say what the resistance of the pot is. Don't use 100 ohms.

3) Most important, get rid of C3. That large capacitor will almost certainly cause the output to oscillate.

4) A heatsink on the MOSFET is a very good idea. In theory, you can dissipate more than a watt in it, so you need a decent heat sink.

5) If you decide to do the prudent thing and actually test this circuit before you hook up to a battery, make sure you put a resistor (like, 10 to 100 ohms @ 1 watt) across the output.

With all that said, you need to rethink what you're doing. Recharging a NIMH cell with constant voltage is almost guaranteed to fail. Either the voltage will be too low, and you get no charge, or the voltage will be too high, and you kill the cell. Do some more research.