replace trim() with regex