Regular Expression Matches
$BASH_REMATCH
is an array and contains the matched text snippets. ${BASH_REMATCH[0]}
contains the complete match. The remaining elements, e.g. ${BASH_REMATCH[1]}
, contain the portion which were matched by ()
subexpressions.
Links
Examples
Print matches :
|
|
Output:
all: name=value with spaces
name: name
value: value with spaces
BashSupport Pro 是一个 支持 $BASH_REMATCH 的 Bash 集成开发工具 – 马上试用!