PatternTest
p?test is a pattern object that stands for any expression that matches p, and on which the application of test gives True.
Examples
Match only integers:
f[x_?IntegerQ] := x^2;
f[5]
(* 25 *)Match only positive:
g[x_?Positive] := Sqrt[x];
g[4]
(* 2 *)Please visit the official Wolfram Language Reference for more details.