We present an algorithm for regular expression parsing and submatch extraction based on tagged deterministic finite automata. The algorithm works with different disambiguation policies. We give detailed pseudocode for the algorithm, covering important practical optimizations. All transformations from a regular expression to an optimized automaton are explained on a step-by-step example. We consider both ahead-of-time and just-in-time determinization and describe variants of the algorithm suited to each setting. We provide benchmarks showing that the algorithm is very fast in practice. Our research is based on two independent implementations: an open-source lexer generator RE2C and an experimental Java library.


翻译:本文提出了一种基于标记化确定性有限自动机的正则表达式解析与子匹配提取算法。该算法适用于不同的消歧策略。我们提供了详细的算法伪代码,涵盖了重要的实际优化技术。通过逐步示例,阐释了从正则表达式到优化自动机的所有转换过程。我们同时考虑了提前确定化与即时确定化,并描述了适用于每种场景的算法变体。基准测试表明,该算法在实际应用中具有极高的执行速度。本研究基于两个独立实现:开源词法分析器生成器RE2C与实验性Java库。

0
下载
关闭预览

相关内容

在数学和计算机科学之中,算法(Algorithm)为一个计算的具体步骤,常用于计算、数据处理和自动推理。精确而言,算法是一个表示为有限长列表的有效方法。算法应包含清晰定义的指令用于计算函数。 来自维基百科: 算法
专知会员服务
33+阅读 · 2021年7月27日
专知会员服务
29+阅读 · 2020年10月2日
【AAAI2021】自监督对应学习的对比转换
专知
12+阅读 · 2020年12月11日
PointNet系列论文解读
人工智能前沿讲习班
17+阅读 · 2019年5月3日
论文浅尝 | Interaction Embeddings for Prediction and Explanation
开放知识图谱
11+阅读 · 2019年2月1日
论文浅尝 | Know-Evolve: Deep Temporal Reasoning for Dynamic KG
开放知识图谱
36+阅读 · 2018年3月30日
Mask R-CNN 论文笔记
统计学习与视觉计算组
11+阅读 · 2018年3月22日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 12月10日
VIP会员
相关资讯
【AAAI2021】自监督对应学习的对比转换
专知
12+阅读 · 2020年12月11日
PointNet系列论文解读
人工智能前沿讲习班
17+阅读 · 2019年5月3日
论文浅尝 | Interaction Embeddings for Prediction and Explanation
开放知识图谱
11+阅读 · 2019年2月1日
论文浅尝 | Know-Evolve: Deep Temporal Reasoning for Dynamic KG
开放知识图谱
36+阅读 · 2018年3月30日
Mask R-CNN 论文笔记
统计学习与视觉计算组
11+阅读 · 2018年3月22日
相关基金
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员