Skip to content

Repository files navigation

Verification of realistic regex matching

Modern regular expressions (regexes) are a powerful tool for finding patterns in text. Modern features such as capturing groups, lookarounds, and backreferences turn the problem of matching into a complex and error-prone task. Real-world implementations additionally employ a large variety of optimizations and heuristics to speed up matching in practice. In this work we don’t shy away from this complexity but instead tame it by providing a formalization of realistic regex matching that includes all of the cumbersome aspects. In the Rocq proof assistant, we provide the formalization and proof of correctness of a prefix acceleration optimization in the PikeVM. We additionally formalize optimizations such as anchored regexes and impossible matches. We combine all of them to produce a realistic matching algorithm which is proven to return matches defined by the ECMAScript 2023 standard.

This repository documents my master thesis at EPFL in the SYSTEMF lab.

Supervised by Aurèle Barrière and Clément Pit-Claudel.

See here for all the compiled documents. Notably, the final thesis PDF. This project mainly involved working in the following repos:

Repository structure

./proposal

The presentation and textual proposal of the project before work has begun on it.

./meeting_notes

Weekly notes taken for progress tracking and for recording action items from meetings with my supervisors.

./progress_presentation

Script and graphics used for a progress presentation.

./report

The written report of the entire project. See the GitHub action for instructions on how to lint and compile the report.

./final_presentation

The presentation used for my thesis defense and shorter versions for PhD interviews or invited talks.

./public

The deployed website of this thesis.

About

Verification of realistic regex matching in Rocq prover

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages