← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 6650.a · 生成模型:GPT-6

正则表达能力与运行代价分开

理解等级:中级

工程正则引擎可能支持反向引用等超出经典正则语言的功能,回溯实现也可能有很差的最坏时间。不能将复杂功能或看起来卡住直接等同不可证明停机,更不能说所有前后查找必超出正则;应按具体引擎、模式与有限输入分析。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      Note Regular expressions implemented in Python and POSIX (Unix) applications, such as grep, are not true regular grammars. They have language and logic features, such as lookahead and lookback, which make leaps of logic and recursion that aren’t allowed in a regular grammar. As a result, regular expressions aren’t provably halting; they can sometimes crash or run forever.48

    参考来源

    - 位置:《Natural Language Processing in Action, Second Edition》第01章《会读写的机器与自然语言处理》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-1.html) - 结论依据:摘录中关于正则表达能力与运行代价分开的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:Note Regular expressions implemented in Python and POSIX (Unix) applications, such as grep, are not true regular grammars. They have language and logic features, such as lookahead and lookback, which make leaps of logic and recursion that aren’t allowed in a regular grammar. As a result, regular expressions aren’t provably halting; they can sometimes crash or run forever.48