Ruby - Regular Expressions
Identify the error in this Ruby code snippet using named captures:
text = "Code: 42"
regex = /Code: (?\d+)/
match = regex.match(text)
puts match[:code]