with 1,0,2,1,6 or 0,0,4,1,7
I want to get 10111 or 00111

then replacing any number > 1 by 1 and remove any coma

I am looking for a regex.replace(myString, regExpression, 1)

regExpression should something like

(,[2-9]) or ([2-9],)

thank you