guarda nelle funzioni eregi_replace,
per ora ho difficoltà a fare dei test.

saluti