Overview
We can use the below sign to have ruby regex match in an if check
=~
Program
Let’s see an example of the same
if /\d/ =~ "3"
puts "Match"
else
puts "No match"
end
Output
Match
Note: Check out our system design tutorial series System Design Questions