Remove unrecognised symbols from "$procuniq"

Errors in log files and can't draw images, but removing some symbols in "$procuniq[$i]" internal variable removes problems:
1) removing slash - allowed to draw some graphs
2) removing minus - allow to draw other graphs
Removed symbols are minuses, dots, slashes,... probably need to add more for different cases, but in mine this was the problem.
My setup: nginx + FastCGI to generate PNGs and HTMLs
Example what procs I am drawing:
java -Djava.util.logging.config.file=/opt/tomcat-1/conf
So, there are lot of similar java processes, and grep line (procargs) was "tomcat-1/", now internal name for this replaced to "tomcat1"