Whenever we become aware of having performed an unskillful act, regret is beneficial and necessary. It is the first of the ‘four powers’ of purification (regret, reliance, resolve, reparation).
Regret is defined as the realization that negative acts produce negative effects, and that no lasting advantage can be gained from them.
The traditional image associated with regret is that of becoming aware of having swallowed poison: we feel a strong motivation to do whatever may be necessary to expel it and counter its effects.
Regret is not guilt. It is the urgent motivation to undo the harm we have caused others and ourselves.
Guilt is self-condemnation. It is impotent, self-indulgent, and produces the desire to hide, dissimulate, and obfuscate.