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

Update regex patterns to support multi-line mode in CLI and add tests. #82

Merged
merged 1 commit into from
Nov 30, 2024

Conversation

catatsuy
Copy link
Owner

This pull request introduces changes to support multi-line mode in the compileRegexps function and adds corresponding tests to ensure the new functionality works as expected.

Changes to regex compilation:

  • internal/cli/cli.go: Modified the compileRegexps function to include the m flag for multi-line mode when compiling regular expressions. This change ensures that the regexes are treated as multi-line patterns.

Additions to test cases:

  • internal/cli/cli_test.go: Added a new test function TestRun_MultiLineMode to cover various scenarios for the multi-line mode. This includes tests for excluding empty lines, lines with only spaces, lines starting with a specific character, filtering lines starting with a specific word, filtering lines containing a word, and replacing specific lines or words in multiple lines.

@catatsuy catatsuy merged commit 450597a into main Nov 30, 2024
5 checks passed
@catatsuy catatsuy deleted the feature-multiline-support-in-cli branch November 30, 2024 07:43
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.

None yet

1 participant