Skip to content

Commit

Permalink
released 3.12.7
Browse files Browse the repository at this point in the history
Like GNU grep, unpaired ) in regex are matched literally when option -Y is used and by the grep and egrep aliases of ugrep
  • Loading branch information
genivia-inc committed Aug 14, 2023
1 parent c361d55 commit 31e6d2c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Binary file modified bin/win32/ugrep.exe
Binary file not shown.
Binary file modified bin/win64/ugrep.exe
Binary file not shown.
5 changes: 3 additions & 2 deletions src/ugrep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7601,10 +7601,11 @@ void ugrep()
// reflex::Matcher options
std::string matcher_options;

// -Y: permit empty pattern matches and match closing ) when no opening (
// -Y: permit empty pattern matches and match closing ) when no opening ( unless -P and -F
if (flag_empty)
{
convert_flags |= reflex::convert_flag::closing;
if (!flag_perl_regexp && !flag_fixed_strings)
convert_flags |= reflex::convert_flag::closing;
matcher_options.push_back('N');
}

Expand Down

0 comments on commit 31e6d2c

Please sign in to comment.