Skip to content

Fix zero-width regex replace all (#775)#815

Open
MihneaTeodorStoica wants to merge 1 commit intomicrosoft:mainfrom
MihneaTeodorStoica:fix-zero-width-replace-all
Open

Fix zero-width regex replace all (#775)#815
MihneaTeodorStoica wants to merge 1 commit intomicrosoft:mainfrom
MihneaTeodorStoica:fix-zero-width-replace-all

Conversation

@MihneaTeodorStoica
Copy link
Copy Markdown

Summary

  • fix find_and_replace_all() so zero-width regex matches advance past the replacement instead of re-matching the same location
  • return the matched range from find_select_next() so replace-all can distinguish zero-width matches from normal matches
  • add regression tests for both single replace and replace-all with the $ regex

Testing

  • cargo test replace_all_supports_zero_width_regex_matches --lib -- --nocapture
  • cargo test replace_supports_zero_width_regex_matches --lib -- --nocapture
  • cargo test

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