知识卡片

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

标准正则与第三方扩展需区分

理解等级:中级

re是Python标准库,regex是提供额外Unicode或模糊功能的第三方包,不是取代re的新官方模块。二者相似接口也可能有边界差异,应按实际需求和固定版本选择,不能无检查互换。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      The re package is the default regex compiler/interpreter in Python, but the new official package is regex and can be easily installed with pip install regex. It’s more powerful, with better support for Unicode characters and fuzzy matching (pretty awesome for NLP). You don’t need those extra features for the examples here, so you can use either one. You only need to learn a few

    参考来源

    - 位置:《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) - 结论依据:摘录中关于标准正则与第三方扩展需区分的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:The re package is the default regex compiler/interpreter in Python, but the new official package is regex and can be easily installed with pip install regex. It’s more powerful, with better support for Unicode characters and fuzzy matching (pretty awesome for NLP). You don’t need those extra features for the examples here, so you can use either one. You only need to learn a few