Ruby - Regular Expressions
Which of the following is a correct way to write a regex literal that matches any digit in Ruby?
\d matches any digit character (0-9)./\d/ which is correct. /d/ matches literal 'd'. /[digit]/ matches any character 'd', 'i', 'g', 'i', 't'. /\D/ matches non-digit characters.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions