2. Given a square $ABCD$ with side length $5$, $P$ is a point inside the square, and $PA=\sqrt{5}, PC=5$. Then $PB=$ $\qquad$
2. $\sqrt{10}$ or $2 \sqrt{5}$.

As shown in Figure 4, draw $P E \perp$ $A B$ at point $E$, and $P F \perp B C$ at point $F$.
Let $P E=m, P F=n$.
In the right triangles $\triangle P A E$ and $\triangle P C F$, by the Pythagorean theorem, we get
$$
\left\{\begin{array}{l}
m^{2}+(5-n)^{2}=5, \\
(5-m)^{2}+n^{2}=25 .
\end{array}\right.
$$
Subtracting (1) from (2) gives $10(n-m)=20$.

Therefore, $m=n-2$.
Substituting into equation (1) yields $n^{2}-7 n+12=0$.
Solving gives $n=3$ or 4.
When $n=3$, $m=n-2=1$, in the right triangle $\triangle P B E$, by the Pythagorean theorem, we get
$$
P B=\sqrt{m^{2}+n^{2}}=\sqrt{10} \text {. }
$$

When $n=4$, $m=n-2=2$.
Similarly, $P B=2 \sqrt{5}$.
In summary, $P B=\sqrt{10}$ or $2 \sqrt{5}$.