Replies: 3 comments 1 reply
-
Yes, but that is a specific toy example with only one subpattern. What about For example, formulating an alternative for
I think this is a tipsy-turvy view of things, because users use |
Beta Was this translation helpful? Give feedback.
-
I'll update the man page to be more clear about the benefit: -Y, --empty
Empty-matching patterns match all lines. Normally, empty matches
are not output, unless a pattern begins with `^' or ends with `$'.
With this option, empty-matching patterns, such as x*y?, x*y*z*,
and x*(y?|z) match all lines instead of the intended pattern.
This option is enabled by default in grep compatibility mode,
in that case specify option --no-empty to prevent matching all. Note: |
Beta Was this translation helpful? Give feedback.
-
An appeal to a "subjective intent" in the phrasing is almost unavoidable to bring the message across. I would argue that "expected" rather than "intended" is preferable IMO, with a subtle hint to the POLS: "[...] match all lines, not only the expected pattern." |
Beta Was this translation helpful? Give feedback.
-
As of ugrep v7.3.0, the manual states:
First off, I'm new to
ugrep
and quite excited there's-Y
to ensure standard matching behavior, allowing it to be used as a drop-in replacement for e. g. GNU grep.This question is rather about the deviating default, in the first place.
As I derive from #287 , it's mainly performance motivated. However, doesn't
'a+'
readily do the same thing?If it does, why would a regexp matching tool assume by default that users running
ugrep 'a*'
(slower) actually mean to runugrep 'a+'
instead (faster, but different), as if they couldn't do just that equally well wherever desired? The core effect of (mis)?taking'a*'
for'a+'
that I can see is annihilating the difference between the two, thereby harming expressibility (and standard compliance) for no real use.Please note, this question is not answered by one of them being much more commonly encountered than the other. If by
alias hyena=dog
, you interpret two originally non-synonymous expressions as synonyms, you take away expressibility from their distinct meanings: speakers won't be able to refer to a hyena by its name anymore (even if more elaborate expressions might still do), for the questionable merit of henceforth being able to refer to a dog by both, "a dog" or "a hyena".What am I missing?
Beta Was this translation helpful? Give feedback.
All reactions