Solaris Common Desktop Environment: User's Guide

Pattern Searches

In a pattern search certain characters (known as "wildcards") have special meaning. You can combine these characters in a variety of ways.

Two frequently used wildcards are asterisk (*) and question mark (?). The * matches any string of characters (including no characters), and ? matches any single character. Other wildcards include:

. (period)--matches any character

| (vertical bar)--specifies two search patterns and matches either pattern (logical OR)

( ) (parentheses)--encloses a pattern expression

To search for a character that has special meaning in a regular expression, precede the character with a \ (backslash).

Examples

mouse.*clicking--matches entries that contain the word "mouse" followed by any number of characters followed by "clicking"

mouse | click--matches entries that contain the word "mouse" or "click"

(session | style)*manager--matches entries that contain "Session Manager" or "Style Manager"