fix regex for trimming