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

Proposal: regular expression package #365

Open
yj-qin opened this issue May 6, 2024 · 0 comments
Open

Proposal: regular expression package #365

yj-qin opened this issue May 6, 2024 · 0 comments
Labels

Comments

@yj-qin
Copy link
Collaborator

yj-qin commented May 6, 2024

We need a simple and compact regular expression package that supports the POSIX’s Extended Regular Expressions syntax (Maybe extend to PCRE syntax in the future). This package needs to be able to compile a regular expression and use it to match or replace given strings.

Consideration:
Which style of the regular expression engine should we implement? There are two main styles: backtracking and automata. The backtracking style is used by popular languages like Java, Python, and JavaScript. This style allows for more features but can result in bad performance in some cases. The automata style is used by Rust's regex crate and Go's regex std. While it may not allow for certain features that rely on backtracking, it can match regex in linear time.

References:

@yj-qin yj-qin added the proposal label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant