System Administration Guide: Naming and Directory Services (NIS+)

About Regular Expressions in NIS+

Regular expressions are combinations of text and symbols that you can use to search for special configurations of column values. For example, the regular expression `Hello' searches for a value that begins with Hello. When using a regular expression in the command line, be sure to enclose it in quotes, since many of the regular expression symbols have special meaning to the Bourne and C shells. For example:

rootmaster% nisgrep -h greeting='Hello'

The regular expression symbols are summarized in Table 19–7, below.

Table 19–7 Regular Expression Symbols in NIS+




Find a value that begins with string.

string $

Find a value that ends with string.

Find a value that has a number characters equal to the number of periods. 


Find a value that contains any of the characters in the brackets. 


Find a value that has zero or more matches of the expr.


Find something that appears one or more times. 


Find any value. 


Find a special character, such as ? or $. 

x | y

Find a character that is either x or y.