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

Allow replacing with nothing in replacements file #239

Merged
merged 2 commits into from
Oct 27, 2023

Conversation

vmartinv
Copy link
Contributor

@vmartinv vmartinv commented Oct 24, 2023

This fix should address #173, happening when the user wants to remove a given string from the input. In such case they can now write a single line in the replacement file containing:
<regex_to_be_removed><TAB>
The fix uses the additional limit argument to the split function (explained here), such that in the case mentioned it actually adds an empty string in the parts variable. This achieves the desired behaviour without adding additional spaces as can be seen in the test.

There is also a minor change to comment parsing which I think makes it more intuitive.

@sylvainhalle sylvainhalle merged commit 140ea41 into sylvainhalle:master Oct 27, 2023
3 checks passed
@vmartinv vmartinv deleted the replace_nothing branch October 28, 2023 10:46
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.

2 participants