Are regular expressions worth the hassle?

后端 未结 24 1475
说谎
说谎 2020-12-03 13:58

It strikes me that regular expressions are not understood well by the majority of developers. It also strikes me that for a lot of problems where regular expressions are use

24条回答
  •  长情又很酷
    2020-12-03 14:03

    In .NET regex'es you can have comments, and break them up into multiple lines, use indenting etc. (I don't know about other dialects...)

    Use the "ignore pattern whitespace" setting, and either # for commenting out the rest of the line, or "(#comments)" in your pattern...

    So if you wanted to, you can actually make them sort of readable/maintainable...

提交回复
热议问题