正则表达式交集检查器
interegular的Python项目详细描述
间歇
{emex}交叉点<$emex^>
一个库,用于检查python正则表达式的子集是否存在交集。 根据@qntm基于{a1}。改编为lark-parser
注意:由于使用了annotations/dataclasses,这个包not向后兼容python版本<;=3.5。因为这只是一小部分用户,所以我选择忽略这个“问题”。在
接口
Function | Usage |
---|---|
^{ | Takes a series of regexes as strings and returns a Generator of all intersections as ^{ |
^{ | Parses a regex as string to a ^{ |
^{ | Takes a series of regexes as patterns and returns a Generator of all intersections as ^{ |
^{ | A class representing a parsed regex (intermediate representation) |
^{ | A enum representing the flags a regex can have |
^{ | A class representing a fully parsed regex. (Has many useful members) |
^{ | A function to change the flags that are applied to a regex |
^{ | A function to create a ^{ |
^{ | A Class to compare a group of Patterns |
支持什么?在
大多数普通的python regex语法都是支持的。但是由于使用了后端(最终状态机),有些东西无法实现。这包括:
- 向后引用(
\1
,(?P=open)
) - 条件匹配(
(?(1)a|b)
) - 一些lookaheads/lookbacks的例子(你必须尝试哪些工作,哪些没有)
- 警告:这是目前没有正确处理,有些东西可能会解析,但不能正确工作。我现在正在做这个。在
有些事情根本没有实施,将来会实施:
- 某些标志(进度:
ims
来自aiLmsux
) - 一些lookaheads/lookbacks的例子(你必须尝试哪些工作,哪些没有)
托多
- 文件
- 更多测试
- 检查语法是否正确处理。在
- 项目
标签: