Trying to get sed to replace a filepath in a file with another filepath
===

 This is my current code. I am trying to replace a filename string in the file with another filename. But I am currently getting the error 

"sed: 1: "s/directory = "[A-Za-z0 ...": bad flag in substitute command: 'U'"

What is wrong with this code?



    function restart_existing ()
    {
    	old="directory = \"[A-Za-z0-9\/]\""
    	new="directory = \"$1\""
    	sed -i '' "s/$old/$new/" "$HOME/angelpretendconfig" 
    }
    
    
    restart_existing "$HOME/blahblahblah/shoot/blah"

