更新时间:2023-02-10 21:47:08
这将起作用:
sed -e 's/\(.* \)\(.\{8\}\)\(.*\)}/\1-\2.\32/' <<< '123 00}000150}'
\1
将具有值:123
(从第一个字符到第一个空格的匹配项)
\1
will have value: 123
( Matches from first character till first space)
\2
:00}00015
(后8个字符)
\3
:0
(找到下一个}
之前的字符)
\3
: 0
( Characters until next }
is found)