4. Given $m>0$, the equation about $x$
$$
(m x-3+\sqrt{2})^{2}-\sqrt{x+m}=0
$$

has exactly two distinct real roots in the interval $[0,1]$. Then the range of the real number $m$ is $\qquad$
4. $[3,193-132 \sqrt{2}]$.

Let $f(x)=(m x-3+\sqrt{2})^{2}, g(x)=\sqrt{x+m}$.
From the graph, we know that $m$ satisfies
$$
\left\{\begin{array}{l}
f(0) \geqslant g(0), \\
f(1) \geqslant g(1), \\
03-\sqrt{2}$.
From equation (2), we get
$$
(m-3+\sqrt{2})^{2} \geqslant \sqrt{1+m} \text {, }
$$

From the graph, we know that $(m-3+\sqrt{2})^{2}=\sqrt{1+m}$ has exactly two real roots $m_{1}$ and $m_{2}$, and $m_{1}<3-\sqrt{2}<m_{2}$.
Then from equation (4) $\Rightarrow-1 \leqslant m \leqslant m_{1}$ or $m \geqslant m_{2}$.
Clearly, $m_{2}=3$.
In summary, $m \in[3,193-132 \sqrt{2}]$.