How important is knowing Regexs?

前端 未结 16 1664
没有蜡笔的小新
没有蜡笔的小新 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:12

    When you have to parse something (ranging from simple date strings to programming languages) you should know your tools and regular expressions are one of them.

    But you should also know what you can do with regexes and what not. At this point it comes in handy if you know the Chomsky hierarchy hierarchy. Otherwise you end up trying to use regular expressions to parse context-sensitive languages and wonder why you can't get your regex right.

提交回复
热议问题