Skip to content

import lazy DFA based regex#3141

Merged
bobzhang merged 3 commits intomainfrom
yuxiang/regex
Jan 15, 2026
Merged

import lazy DFA based regex#3141
bobzhang merged 3 commits intomainfrom
yuxiang/regex

Conversation

@hackwaly
Copy link
Copy Markdown
Contributor

@hackwaly hackwaly commented Jan 12, 2026

This PR introduces a lazy DFA based regex engine. It will replace the exist slow NFA based regex engine in core.

TODOs

  • Add tests
  • @string.Regex and @bytes.BytesRegex api surface.
  • Add bridge between moonc and regex.
  • Moonc ready

@hackwaly hackwaly marked this pull request as draft January 12, 2026 07:11
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Jan 12, 2026

Pull Request Test Coverage Report for Build 2392

Details

  • 572 of 802 (71.32%) changed or added relevant lines in 32 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.9%) to 95.589%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/regex_engine/automata/state.mbt 10 11 90.91%
internal/regex_engine/positions.mbt 5 6 83.33%
internal/regex_engine/shared_types/category.mbt 8 9 88.89%
internal/regex_engine/symbol_map/sparse_table.mbt 7 8 87.5%
internal/regex_engine/symbol_map/symbol_map.mbt 27 28 96.43%
internal/regex_engine/automata/mark_slot_map.mbt 7 10 70.0%
internal/regex_engine/automata/delta.mbt 55 60 91.67%
internal/regex_engine/automata/slot_book.mbt 8 14 57.14%
internal/regex_engine/execute.mbt 54 60 90.0%
internal/regex_engine/ast/pattern.mbt 29 39 74.36%
Totals Coverage Status
Change from base Build 2391: -1.9%
Covered Lines: 11008
Relevant Lines: 11516

💛 - Coveralls

@hackwaly hackwaly changed the title import lazy DFA based regex/core import lazy DFA based regex Jan 12, 2026
@hackwaly hackwaly force-pushed the yuxiang/regex branch 2 times, most recently from b231bf5 to 803b97b Compare January 12, 2026 08:58
@hackwaly hackwaly force-pushed the yuxiang/regex branch 12 times, most recently from b941927 to 871fa7c Compare January 13, 2026 14:28
@hackwaly hackwaly marked this pull request as ready for review January 15, 2026 06:20
@hackwaly hackwaly requested a review from bobzhang January 15, 2026 06:20
@bobzhang bobzhang merged commit 956a93f into main Jan 15, 2026
14 checks passed
@bobzhang bobzhang deleted the yuxiang/regex branch January 15, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants