regex saving bug