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

Use ECMAScript syntax for regular expressions #478

Closed
Razican opened this issue Jun 11, 2020 · 5 comments · Fixed by #774
Closed

Use ECMAScript syntax for regular expressions #478

Razican opened this issue Jun 11, 2020 · 5 comments · Fixed by #774
Labels
builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request
Milestone

Comments

@Razican
Copy link
Member

Razican commented Jun 11, 2020

Current situation
Currently, we use regular expressions from the regex crate. They are extremely fast, but they don't support the full ECMAScript syntax like backreferences or lookaround assertions.

Solution
We should use a library that does support all this syntax. A nice library that was just released and seems to support this is regress.

We should remove our dependency on regex and use regress, and see how the performance gets affected.

@Razican Razican added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels Jun 11, 2020
@neeldug
Copy link
Contributor

neeldug commented Jun 17, 2020

Hi!
I've currently looked over the regress API, and it seems to be missing quite a few methods that are necessary, any suggestions on whether to proceed trying to implement regress?

@Razican
Copy link
Member Author

Razican commented Jun 18, 2020

One option would be to implement those methods in regress. What would we need?

@neeldug
Copy link
Contributor

neeldug commented Jun 18, 2020

Specifically I've been looking into regress's API and it actually does have a lot of the methods just labelled differently or structured differently, currently working on trying to refactor everything involving regex into regress atm.

@neeldug
Copy link
Contributor

neeldug commented Jun 19, 2020

Have been working on refactoring regexp and string, and managed to finish string, however, am a little stuck on the regexp regex implementations, especially with working with the capture groups that regress has got strange methods, if anyone is able to help, would be much appreciated.

@Razican
Copy link
Member Author

Razican commented Jun 22, 2020

Have been working on refactoring regexp and string, and managed to finish string, however, am a little stuck on the regexp regex implementations, especially with working with the capture groups that regress has got strange methods, if anyone is able to help, would be much appreciated.

Hey, do you have the code you are working on? Maybe create a draft PR so that we can give you feedback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants