Rough idling

Does anyone think the voltage regulator could cause the engine to miss? At night when its idling, and the lights are on, every time it misses, the lights dim.