News for hackers. Stuff that matters.
Re:ECMAScript proposal: String.prototype.replaceAll by pier25 on Saturday December 21, 2019 @11:42PM (#21855228)
Why would using regex pollute your code?
Re:ECMAScript proposal: String.prototype.replaceAll by Normal_gaussian on Sunday December 22, 2019 @12:06AM (#21855313)
It depends on who you ask; however the thinking is often:

* They can indicate poor parsing (ie can't read xml with regex) and failure to use programmatic methods (e.g parsing command output rather than making syscalls)

* regexes are very easy to write incorrectly without being obviously wrong

* regexes are often overkill for a direct match

* regexes invite people to make it more complex rather than restructure surrounding code

* regexs are comparatively more expensive than alternative code

* to work on the codebase you are now required to understand regex in general and this particular implementations quirks as well

I often use regexes, and I often choose not to use regexes.