I am using Linux. I got a yml file and I want to delete this using sed :
exposureMachineSshAccess  
  username:
  password:
  whiteList:
    - mLB99
    - mLB10
  machines:
  - machineId:
    username: ''
    password: ''
  - machineId:
    username: ''
    password: ''
I've created this regex and it looks ok:
exposureMachineSshAccess:\n([ ].*\n)+
And I'm calling this :
sed -i '/exposureMachineSshAccess:\n([ ].*\n)+/d'  /home/common_config.yml
sed -i 's/exposureMachineSshAccess:/d/gm' /home/common_config.yml
If I remove the regex I got the file changed but it doesn't work the other way around. What is wrong?
 
     
     
    