Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Megular Expressions #263

Draft
wants to merge 9 commits into
base: marco/multiaddr-refactor
Choose a base branch
from

Conversation

MarcoPolo
Copy link
Contributor

A very simple regular expression matcher for Multiaddr components. Supports capturing values. Matches in linear time (no back tracking).

The core logic is about 100 LOC. The sugar to make it nicer to use is about another 100 LOC.

Motivation

If we are going to treat Multiaddrs as encoding, then we need to make it more ergonomic to parse multiaddrs. Right now we have a lot of somewhat wrong manual parsers using ForEach. This should be able to replace those, make it cleaner, and most importantly make them obviously correct.

In draft while I try this out in go-libp2p.

@MarcoPolo MarcoPolo requested a review from sukunrt January 16, 2025 21:57
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.

1 participant