The regexp command provides direct access to the regular expression matcher. Not only does it tell you whether a string matches a pattern, it can also extract one or more matching substrings. The return value is 1 if some part of the string matches the pattern; it is 0 otherwise. Its syntax is:
regexp ?flags? pattern string ?match sub1 sub2...?
The flags are described in Table 11-6:
|-nocase||Lowercase characters in pattern can match either lowercase or uppercase letters in string.|
|-indices||The match variables each contain a pair of numbers that are in indices delimiting the match within string. Otherwise, the matching string itself is copied into the match variables.|
|-expanded||The pattern ...|