Next: , Previous: , Up: Command-line commands   [Contents][Index]

17.4.62 regexp

Command: regexp [--set [number:]var] regexp string

Test if regular expression regexp matches string. Supported regular expressions are POSIX.2 Extended Regular Expressions. If option --set is given, store numberth matched subexpression in variable var. Subexpressions are numbered in order of their opening parentheses starting from ‘1’. number defaults to ‘1’.