bash不支持正则表达式扑捉吧?

bash不支持正则表达式扑捉吧?

For capture and counts ( )
Non-capturing (?: )
Named Captures (?<name> )

$n reference capture      
可以 di
引用:
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=16263 $?=0] ; echo $BASH_VERSION
3.2.39(1)-release
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=16263 $?=0] ; re='([0-9]+)\.([0-9]+)\.([0-9]+)'
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=16263 $?=0] ; [[ $BASH_VERSION =~ $re ]]
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=16263 $?=0] ; echo ${BASH_REMATCH[0]}
3.2.39
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=16263 $?=0] ; echo ${BASH_REMATCH[1]}
3
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=16263 $?=0] ; echo ${BASH_REMATCH[2]}
2
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=16263 $?=0] ; echo ${BASH_REMATCH[3]}
39
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=16263 $?=0] ; bye
      
扑捉
BS是E文看多了

即使是Perl, 也不支持(?<name> )这东西(好东西来着)
Bash直接支持RE, 还真是挺方便, 免去不少grep      
学习一下BASH_REMATCH