They implemented trim with a regex? Neither Java nor .NET do that.
The postmortem here should probably be "why are you reimplementing trim".
The postmortem here should probably be "why are you reimplementing trim".
1: https://msdn.microsoft.com/en-us/library/d4tt83f9(v=vs.110)....