Can not extract the capture group with neither sed nor grep

后端 未结 5 1695
猫巷女王i
猫巷女王i 2021-01-30 08:16

I want to extract the value pair from a key-value pair syntax but I can not.
Example I tried:

echo employee_id=1234 | sed \'s/employee_id=\\([0-9]+\\)/\\1/         


        
5条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-30 09:19

    use sed -E for extended regex

        echo employee_id=1234 | sed -E 's/employee_id=([0-9]+)/\1/g'
    

提交回复
热议问题