Hacker News new | past | comments | ask | show | jobs | submit login

No, the regex was an actual trim. And they have indeed switched to that. The edge case that caused the slow performance was a lot of whitespace that did not appear at the start or end of the string. The regex would not remove that, nor would trim, but trim is much more efficient in doing the exact same thing. The regex may have been correct, but I doubt the expectations of the developer were met and it most definitely was the wrong tool for the job.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: