Complete the code to create a regex that matches the word 'cat'.
pattern = /[1]/The regex literal /cat/ matches the exact string 'cat'.
Complete the code to check if the string 'hello' contains the letter 'e'.
if 'hello' =~ /[1]/ puts 'Found e' end
The regex /e/ matches the letter 'e' in the string 'hello'.
Fix the error in the regex literal to match any digit.
pattern = /[1]/The regex /\d/ matches any digit character. The backslash must be escaped in Ruby regex literals.
Fill both blanks to create a regex that matches a word starting with 'a' and ending with 'z'.
pattern = /[1].*[2]/
The regex /^a.*z$/ matches strings starting with 'a' and ending with 'z'.
Fill all three blanks to create a regex that matches a string with exactly three digits.
pattern = /^[1][2][3]$/
\w which matches letters and digits.\s which matches whitespace.The regex /^\d\d\d$/ matches exactly three digits from start to end.
