1

grep supports backslash based character classes (e.g. \s) in ERE:

echo "x    y" | grep -E 'x\s+y'
x    y

Is it an (GNU) extension? If yes, then is it documented? If yes, then where is it documented?

Reason for the question: LLVM's FileCheck supports ERE ("it supports Extended POSIX regular expressions (ERE)").

However, it seems that FileCheck does not support backslash based character classes in ERE. So, I'm wondering whether support of backslash based character classes in ERE in grep is an (GNU) extension OR whether missing support of backslash based character classes in ERE in FileCheck is a bug.

In grep's documentation for The Backslash Character and Special Expressions I didn't find any mentioning that support of such backslash based character classes (i.e. which is a synonym for [xxx]) is an (GNU) extension.

pmor
  • 464

0 Answers0