How important is knowing Regexs?

前端 未结 16 1647
没有蜡笔的小新
没有蜡笔的小新 2021-02-06 05:23

My personal experience is that regexs solve problems that can\'t be efficiently solved any other way, and are so frequently required in a world where strings are as important as

16条回答
  •  执念已碎
    2021-02-06 06:15

    REs let you solve relatively complex problems that would otherwise require you to code up full parsers with backtracking and all that messy sort of stuff. I liken the use of REs to using chainsaws to chop down a tree instead of trying to do it with a piece of celery.

    Once you've learned how to use the chainsaw safely, you'll never go back. People who continue to spout anti-RE propaganda will never be as productive as those of us who have learned to love them.

    So yes, you should know how to use REs, even if you understand only the basic constructs. They're a tool just like any other.

提交回复
热议问题