支持交集、补集和环视的基于导数的扩展正则表达式匹配
Derivative Based Extended Regular Expression Matching Supporting Intersection, Complement and Lookarounds
AI总结:
本文提出基于符号导数的扩展正则表达式匹配方法,支持补集、交集及正负先行/后行环视,并通过布尔代数重写优化与实现验证其有效性。
摘要:
正则表达式在软件中被广泛使用。各种正则表达式引擎支持对经典正则构造(如 Kleene 星号、连接、非确定选择(在匹配语义方面称为并集))的不同扩展组合。这些扩展包括例如锚点、环视、计数器和反向引用。此类扩展组合的性质一直是近期活跃研究的主题。在本文中,我们提出了一种基于符号导数的方法,用于查找正则表达式的匹配;除经典正则构造外,这些表达式还支持补集、交集和环视(包括否定和肯定的先行断言与后行断言)。文中给出了在给定输入字符串时计算符号导数并确定可空性的理论,表明这种扩展组合产生了对应于有效布尔代数的匹配语义,从而为应用各种布尔逻辑重写规则来优化匹配搜索提供了可能。除理论框架外,我们还给出了该扩展组合的实现,并结合实际示例证明该方法的有效性。
英文摘要:
Regular expressions are widely used in software. Various regular expression engines support different combinations of extensions to classical regular constructs such as Kleene star, concatenation, nondeterministic choice (union in terms of match semantics). The extensions include e.g. anchors, lookarounds, counters, backreferences. The properties of combinations of such extensions have been subject of active recent research. In the current paper we present a symbolic derivatives based approach to finding matches to regular expressions that, in addition to the classical regular constructs, also support complement, intersection and lookarounds (both negative and positive lookaheads and lookbacks). The theory of computing symbolic derivatives and determining nullability given an input string is presented that shows that such a combination of extensions yields a match semantics that corresponds to an effective Boolean algebra, which in turn opens up possibilities of applying various Boolean logic rewrite rules to optimize the search for matches. In addition to the theoretical framework we present an implementation of the combination of extensions to demonstrate the efficacy of the approach accompanied with practical examples.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。