I'm trying to get the regex to work that I found in a question here... so I put the script together but I'm getting some syntax errors. please have a look for me.
require 'yaml'
f = File.open("file.txt")
content = f.read
r = Regex.new(^(\d{13})?$)
ids = content.scan(r).uniq
puts YAML.dump(ids)
This script strips 13 digit numbers from a databump in a text file. Here is the error I'm getting..
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})?$)
Any help would be appreciated. Thank you