Let ω be a weight and F be a closed proper subset of Rn. Then for every function f on Rn belonging to the non quasi-analytic (ω)-class of Beurling (resp. Roumieu) type, there is an element g of the same class which is analytic on Rn∖F and such that Dαf(x)=Dαg(x) for every α∈N0n​ and x∈F