07-18-2023, 10:04 PM
If case is irrelevant, then a **case-insensitive regular expression** is a good solution:
/bcd/i =~ 'aBcDe' # returns nil if no match
or
/bcd/i === 'aBcDe' # returns false if no match
This will also work for multi-line strings.
See Ruby's [Regexp](
/bcd/i =~ 'aBcDe' # returns nil if no match
or
/bcd/i === 'aBcDe' # returns false if no match
This will also work for multi-line strings.
See Ruby's [Regexp](
[To see links please register here]
) class for more information.