知识卡片
正则匹配集合可以是无限的
有限状态自动机可用有限状态描述无限多个字符串,例如a+匹配任意正长度a串。有限的是状态或规则,不是必然有限的匹配文本集合;Python回溯扩展也不能与纯正则语言理论完全等同。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
A regular expression defines a sequence of conditional expressions (if, in Python) that each work on a single character. The sequence of conditionals forms a tree that eventually concludes in a single answer to the question, Is the input string a match or not? Because each regular expression can only match a finite number of strings and has a finite number of conditional branches, it
参考来源
- 位置:《Natural Language Processing in Action, Second Edition》附录B《附录B:Python与正则表达式》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/appendix-b.html)
- 结论依据:摘录中关于正则匹配集合可以是无限的的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:A regular expression defines a sequence of conditional expressions (if, in Python) that each work on a single character. The sequence of conditionals forms a tree that eventually concludes in a single answer to the question, Is the input string a match or not? Because each regular expression can only match a finite number of strings and has a finite number of conditional branches, it