Regular Expressions In Ruby - Study Mode

[#6] What does the d character class represent in a regular expression in Ruby?
Correct Answer

(D) Matches any digit character

[#7] Which metacharacter is used to specify optional characters in a regular expression in Ruby?
Correct Answer

(C) ?

[#8] What does the ^ anchor represent in a regular expression in Ruby?
Correct Answer

(B) Matches the start of a line

[#9] Which method is used to replace occurrences of a pattern in a string with a specified string in Ruby?
Correct Answer

(C) String#gsub

[#10] What does the s character class represent in a regular expression in Ruby?
Correct Answer

(D) Matches any whitespace character