32.20. Valid Metacharacters for Different Unix ProgramsSome regular expression metacharacters are valid for one program but not for another. Those that are available to a particular Unix program are marked by a check () in Table 32-5. Quick reference descriptions of each of the characters can be found in Section 32.21. [Unfortunately, even this table doesn't give the whole story. For example, Sun has taken some of the extensions originally developed for ed, ex, and vi (such as the \< \> and \{min, max\} modifiers) and added them to other programs that use regular expressions. So don't be bashful -- try things out, but don't be surprised if every possible regular expression feature isn't supported by every program. In addition, there are many programs that recognize regular expressions, such as perl, emacs, more, dbx, expr, lex, pg, and less, that aren't covered in Daniel's table. -- TOR] Table 32-5. Valid metacharacters for different programs
In ed , ex, and sed, note that you specify both a search pattern (on the left) and a replacement pattern (on the right). The metacharacters in Table 32-5 are meaningful only in a search pattern. ed, ex, and sed support the additional metacharacters in Table 32-6 that are valid only in a replacement pattern. Table 32-6. Valid metacharacters for replacement patterns
-- DG Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|