Altering the script to clean based on regex