title: Replace serial in zone files with sed
body: <p>I need to replace the serials in my zone files, and I thought the easiest would be to use sed to change this. I have the following line to test.</p>
  
  <pre>
  @ IN SOA    ns1.domain.com. webdev.domain.com. (
          2006080401  ; serial
          8H      ; refresh
          2H      ; retry
          1W      ; expire
          4h)     ; minimum ttl
  
          NS  ns1.domain.com.
          NS  ns2.domain.com.
          MX 10   mail1.domain.com.
          MX 20   mail2.domain.com.
  
  domain.com.      A   255.255.255.255
  mail1           A   255.255.255.255
  mail2           A   10.10.10.10
  
  www         CNAME   domain.com.
  ftp         CNAME   www
  webmail     CNAME   www
  </pre>
  
  <p>The regular expression I've created using <a href="http://rubular.com/" rel="nofollow noreferrer">http://rubular.com/</a> is the following. On rebular it the regex I got matches only one line.</p>
  
  <p><code>\s*[0-9]<em>\s</em>;\s*serial</code></p>
  
  <p>So in sed I would use this as follows.</p>
  
  <p><code>sed -i 's/\s*[0-9]<em>\s</em>;\s*serial/20091218 ; serial/g' *.zone</code></p>
  
  <p>My problem is that this doesn't change anything in the file. I've tried several things already. Thx for your help </p>