Use regex instead of trim functions for removing php tags from snippet code