用空格替换文本OSX Sed



我的文件每行有2个时间戳。我想删除每行使用sed的+0800。我已经尝试了以下标记为";使用的命令";

Example input    
2020-11-17 08:50:42.614276+0800 2020-11-17 08:50:42.000000+0800
Command used
sed -E 's/+d{4}//g'
Actual Output (same as input)
2020-11-17 08:50:42.614276+0800 2020-11-17 08:50:42.000000+0800
Expected Output
2020-11-17 08:50:42.614276 2020-11-17 08:50:42.000000

使用

sed -E 's/+[0-9]{4}//g'

sed -E 's/+[[:digit:]]{4}//g'

因为sed不识别d

最新更新