为什么正则表达式如此具有争议性? [关闭] - Why are regular expressions so controversial? [closed]

问题:

When exploring regular expressions (otherwise known as RegEx-es), there are many individuals who seem to see regular expressions as the Holy Grail. 在探索正则表达式(也称为RegEx-es)时,有许多人似乎将正则表达式视为圣杯。 Something that looks so complicated - just must be the answer to any question. 看起来如此复杂的东西 - 只是必须回答任何问题。 They tend to think that every problem is solvable using regular expressions. 他们倾向于认为使用正则表达式可以解决所有问题。

On the other hand, there are also many people who try to avoid regular expressions at all cost. 另一方面,也有许多人试图不惜一切代价避免使用正则表达式。 They try to find a way around regular expressions and accept additional coding just for the sake of it, even if a regular expressions would be a more compact solution. 他们试图找到解决正则表达式的方法并接受额外的编码只是为了它,即使正则表达式是一个更紧凑的解决方案。

Why are regular expressions considered so controversial? 为什么正则表达式被认为是如此有争议? Is there widespread misunderstandings about how they work? 是否存在关于它们如何工作的普遍误解? Or could it be a broad belief that regular expressions are generally slow? 或者可能是一个普遍的信念,正则表达式通常很慢?


解决方案:

参考一: https://en.stackoom.com/question/3CoZ
参考二: https://stackoom.com/question/3CoZ
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章