Thanks for pointing out how to do this in the Korn shell. I assume you meant to use $hostname (or ${hostname} ) in both places where you used ${color} .
Actually, that is extended pattern matching, not a regular expression.
A pattern-list is a list of one or more patterns separated from each
other with a & or |. A & signifies that all patterns must be matched
whereas | requires that only one pattern be matched. Composite pat-
terns can be formed with one or more of the following sub-patterns:
?(pattern-list)
Optionally matches any one of the given patterns.
*(pattern-list)
Matches zero or more occurrences of the given patterns.
+(pattern-list)
Matches one or more occurrences of the given patterns.
{n}(pattern-list)
Matches n occurrences of the given patterns.
{m,n}(pattern-list)
Matches from m to n occurrences of the given patterns.
If m is omitted, 0 will be used. If n is omitted at
least m occurrences will be matched.
@(pattern-list)
Matches exactly one of the given patterns.
!(pattern-list)
Matches anything except one of the given patterns.