Das hängt davon ab, welche Flaggen Sie an grep übergeben.
Das normale markierungslose grep (was dasselbe wie das Übergeben von -G ist) verwendet "Regelmäßige reguläre Ausdrücke":
-G, --basic-regexp Interpret PATTERN as a basic regular expression (BRE, see below). This is the default.
Wenn Sie -E angeben, werden "erweiterte" reguläre Ausdrücke verwendet:
-E, --extended-regexp Interpret PATTERN as an extended regular expression (ERE, see below). (-E is specified by POSIX.)
Und dann haben Sie -P für Perl reguläre Ausdrücke (PCRE):
-P, --perl-regexp Interpret PATTERN as a Perl regular expression. This is highly experimental and grep -P may warn of unimplemented features.
Grundlegende vs. Erweiterte reguläre Ausdrücke
In regulären Ausdrücken verlieren die Metazeichen?, +, {, |, (Und) ihre besondere Bedeutung. Verwenden Sie stattdessen die Backslash-Versionen \?, +, {, \ |, (und).
Traditionelles egrep hat das " [HKEY_CLASSES_ROOT\CompressedFolder] "EditFlags"=dword:00000000 "BrowserFlags"=dword:00000008 "AlwaysShowExt"="" @="Compressed (zipped) Folder" "FriendlyTypeName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,\ 00,6f,00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,\ 32,00,5c,00,7a,00,69,00,70,00,66,00,6c,00,64,00,72,00,2e,00,64,00,6c,00,6c,\ 00,2c,00,2d,00,31,00,30,00,31,00,39,00,35,00,00,00 [HKEY_CLASSES_ROOT\CompressedFolder\CLSID] @="" [HKEY_CLASSES_ROOT\CompressedFolder\DefaultIcon] @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\ 00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,7a,00,69,00,\ 70,00,66,00,6c,00,64,00,72,00,2e,00,64,00,6c,00,6c,00,00,00 [HKEY_CLASSES_ROOT\CompressedFolder\Shell] @="" [HKEY_CLASSES_ROOT\CompressedFolder\Shell\find] "SuppressionPolicy"=dword:00000080 [HKEY_CLASSES_ROOT\CompressedFolder\Shell\find\command] @=hex(2):43,00,3a,00,5c,00,57,00,49,00,4e,00,44,00,4f,00,57,00,53,00,5c,00,45,\ 00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,2e,00,65,00,78,00,65,00,00,00 [HKEY_CLASSES_ROOT\CompressedFolder\Shell\find\ddeexec] @="[FindFolder(\"%l\", %I)]" [HKEY_CLASSES_ROOT\CompressedFolder\Shell\find\ddeexec\application] @="Folders" [HKEY_CLASSES_ROOT\CompressedFolder\Shell\find\ddeexec\topic] @="AppProperties" [HKEY_CLASSES_ROOT\CompressedFolder\Shell\Open] "BrowserFlags"=dword:00000010 "ExplorerFlags"=dword:00000012 [HKEY_CLASSES_ROOT\CompressedFolder\Shell\Open\Command] @="rundll32.exe zipfldr.dll,RouteTheCall %L" [HKEY_CLASSES_ROOT\CompressedFolder\Shell\Open\ddeexec] @="[ViewFolder(\"%l\", %I, %S)]" "NoActivateHandler"="" [HKEY_CLASSES_ROOT\CompressedFolder\Shell\Open\ddeexec\application] @="Folders" [HKEY_CLASSES_ROOT\CompressedFolder\Shell\Open\ddeexec\ifexec] @="[]" [HKEY_CLASSES_ROOT\CompressedFolder\Shell\Open\ddeexec\topic] @="AppProperties" [HKEY_CLASSES_ROOT\CompressedFolder\ShellEx] [HKEY_CLASSES_ROOT\CompressedFolder\ShellEx\ContextMenuHandlers] [HKEY_CLASSES_ROOT\CompressedFolder\ShellEx\ContextMenuHandlers\ICQMenu] @="" [HKEY_CLASSES_ROOT\CompressedFolder\ShellEx\ContextMenuHandlers\] @="Compressed (zipped) Folder Menu" [HKEY_CLASSES_ROOT\CompressedFolder\ShellEx\DropHandler] @="" [HKEY_CLASSES_ROOT\CompressedFolder\ShellEx\StorageHandler] @=""