Bash | 正規表現でマッチした文字列をキャプチャして使う - Qiita
string =~ …