\documentclass[french]{article}
\usepackage{babel,xcolor,environ,listofitems,xstring}
\newcommand*\colorchar[1]{\textcolor{red}{#1}}
\NewEnviron{essai}[1][0,1,2,3,4,5,6,7,8,9]{%
	\expandarg\exploregroups
	\readlist*\listofchars{#1}%
	\foreachitem\currentchar\in\listofchars{\StrSubstitute\BODY\currentchar{\expandafter\colorchar\expandafter{\currentchar}}[\BODY]}%
	\center\BODY\endcenter}
\begin{document}
\begin{essai}
	J'essaie des nombres 1, 2 et 3520.
\end{essai}

\begin{essai}[a,e,i,o,u,y]
	Les voyelles sont en rouge!
\end{essai}
\end{document}