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

Re.replace doesn't work with zero-length matches #231

Closed
glondu opened this issue Oct 4, 2023 · 1 comment
Closed

Re.replace doesn't work with zero-length matches #231

glondu opened this issue Oct 4, 2023 · 1 comment

Comments

@glondu
Copy link
Contributor

glondu commented Oct 4, 2023

With re 1.11.0, the following:

Re.(replace Pcre.(regexp "^$") ~f:(fun _ -> assert false) "")

returns "". Is it expected? According to me, there is one match (even though it is zero-length), so f should be called once.

Another variation of the phenomenon:

Re.(all Pcre.(regexp "^$") "")

returns the empty list.

@vouillon
Copy link
Member

vouillon commented Dec 8, 2023

This is fixed by #233.

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

No branches or pull requests

2 participants