A regular space is said to be completely regular space if for a closed set $A$ there exists a continuous function$$ f: X \to [0,1] $$ such that$$ f(A^c)=0, \quad f(A)=1. $$
Is this definition valid for completely regular space? If it is not correct then kindly state the correct one.
A quantor over points not in $A$ is missing, and the space is not necessarily assumed to be regular:
A space $X$ is called completely regular iff
We cannot ask for $f[X\setminus A] = \{0\}$! This would fail for almost all spaces, as it would imply that every closed $A$ is both closed and open.
A completely regular space is automatically regular (we can separate points and closed sets). We often assume $X$ is $T_1$ (points are closed) as well, and then the property can be denoted $T_{3\frac12}$. So if regular in your book implies points are closed, then demand that too for completely regular.