DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Regular expressions

Korn shell regular expressions

In addition to the regular expression notations discussed above, the Korn Shell provides its own syntax. The metacharacters used by this syntax are similar to those used by the generic regular expression handling notations:

Operator Meaning
*(regexp) matches 0 or more instances of regexp
+(regexp) matches 1 or more instances of regexp
?(regexp) matches 0 or 1 instances of regexp
@(regexp1|regexp2|. . .) matches regexp1 or regexp2 or . . .
!(regexp) matches any string except regexp
The OR notation given for the @ metacharacter can be combined with any of the other metacharacters. For example, @(apple|pear|kumquat) matches ``apple'' or ''pear'' or ``kumquat'', while !(apple|pear|kumquat) matches any string except ``apple'' or ''pear'' or ``kumquat''.


Previous topic: Regular expressions syntax recognized by programs

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003