title: Ruby Script 13 digit regex syntax
body: <p>I'm trying to get the regex to work that I found in a question <a href="https://stackoverflow.com/questions/3092691/regex-for-field-to-contain-13-digits">here</a>... so I put the script together but I'm getting some syntax errors. please have a look for me. </p>
  
  <pre><code>require 'yaml'
  
  f =  File.open("file.txt")
  content = f.read
  
  r = Regex.new(^(\d{13})?$)
  ids = content.scan(r).uniq
  puts YAML.dump(ids)
  </code></pre>
  
  <p>This script strips 13 digit numbers from a databump in a text file. Here is the error I'm getting.. </p>
  
  <pre><code>ID_Script.rb:7: syntax error, unexpected '^', expecting ')'
  r = Regex.new(^(\d{13})?$)
             ^
  ID_Script.rb:7: syntax error, unexpected $undefined
  r = Regex.new(^(\d{13})?$)
  </code></pre>
  
  <p>Any help would be appreciated. 
  Thank you</p>