Following the seminal paper by Bourgain, Brezis and Mironescu, we focus on the asymptotic behavior of some nonlocal functionals that, for each u ∈ L 2 (R N ), are defined as the double integrals of weighted, squared difference quotients of u. Given a family of weights {ρε}, ε ∈ (0, 1), we devise sufficient and necessary conditions on {ρε} for the associated nonlocal functionals to converge as ε → 0 to a variant of the Dirichlet integral. Finally, some comparison between our result and the existing literature is provided.