minor changes to trim regex