title: Invalid preceding regular expression given by sed
body: <p>I am  and have been working on a sed script file and I am running into an "Invalid Preceding regular expression" error when I run it. Below is the file in its entirety.</p>
  
  <p>I have done much search on  this already, both on this site and else where. Many questions asked here have resulted in needing to be either extend regular expressions something being escaped incorrectly. I have defined this as a extended expresion already as it is needed for the email substitution.</p>
  
  <pre><code>#!/bin/sed -rf
  #/find_this thing/{
  #s/ search_for_this/ replace_with_this/
  #s/ search_for_this_other_thing/ replace_with_this_other_thing/
  #}
  
  #Search and replace #ServerAdmin (with preceding no space) email addresses using a regular expression that has the .com .net and so on domain endings as option so it will find root@localhost and replace it in line with admin's email address.
  
  ServerAdmin/ { 
  s/\b[A-Za-z0-9._%-]+@(?:[a-zA-Z0-9-]+\.)+(\.[A-Za-z]]{2,4})?\b/email@example.com/
  }
  #Enable user's Public HTML directories
  /UserDir/ {
  s/disable$/enable/ 
  s/^#User/User/
  }
  #Replace the only #ServerName (with preceding no space) followed space and text with Our server ip
  /#ServerName */ c\ ServerName server.ip.address.here/
  </code></pre>
  
  <p>I am calling it from termal as ./config-apache.sed /etc/httpd/conf/httpd.conf and get this returned.</p>
  
  <pre><code>/bin/sed: file ./apache-install.sed line 12: Invalid preceding regular expression
  </code></pre>
  
  <p>inside of vim line 12 is i dentified as the single <code>}</code> above <code>#Enable user's Public HTML directories</code></p>