0
  1. grep -G supports Basic Regular Expressions, grep -E Extended ones, and grep -P Perl ones.

    Does Section '8.5.6 ‘grep’ regular expression syntax' in findutils' manual https://www.gnu.org/software/findutils/manual/html_mono/find.html#grep-regular-expression-syntax refer to grep's syntax for Basic Regular Expressions or Extended Regular Expressions?

    Note that findutils' manual has a different section for '8.5.3 ‘egrep’ regular expression syntax' https://www.gnu.org/software/findutils/manual/html_mono/find.html#egrep-regular-expression-syntax. Does it mean that the answer to my question is for BRE?

  2. Does findutils' manual have descriptions for various kinds of regular expression syntaxes up-to-date or outdated in most important parts https://www.gnu.org/software/findutils/manual/html_mono/find.html#Regular-Expressions?

Thanks.

  • 1
    "Outdated" compared to what? – Satō Katsura Feb 27 '17 at 11:02
1

The first section linked in your point 1, 8.5.6 is the standard for grep under the BRE syntax. The second section linked in your point 1, 8.5.3 is the standard syntax for grep under the ERE syntax. The section linked to in your point 2 is at the top of the same group. If you scroll down you will find 8.5.3 and 8.5.6 on the same page. Instead of scrolling down, you can simply click the links at the bottom of 8.5 and it will scroll directly there. All of those section are on the same page, just higher or lower on it.

1

Does it mean that the answer to my question is for BRE?

Yes. grep should be equivalent to grep -G and egrep should be equivalent to grep -E. By default the elisp syntax is used. See the source code for a full feature set.

Does findutils' manual have descriptions for various kinds of regular expression syntaxes up-to-date or outdated in most important parts?

It's "up-to-date" enough for the most part, and it was generated with an automated tool some time ago, so there is little room for human error.

Still, a few newer features, such as equivalence classes and collating symbols are not mentioned. You can refer to the gnulib documentation (which is the underlying library that grep and find use) to read about those.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.