I had mostly been using `===` for matching values to patterns in Ruby. Recently, I discovered that the language also supports the `=~` operator for regular expressions.

The [Ruby Documentation](http://ruby-doc.org/core-2.3.0/Object.html "Ruby Documentation") defines `===` as "case equality" and `=~` as "pattern match".

> 
> Case Equality – For class Object, effectively the same as calling #==, but typically overridden by descendants to provide meaningful semantics in case statements.
> 
> 
> Pattern Match—Overridden by descendants (notably Regexp and String) to provide meaningful pattern-match semantics.
> 
> 
> 

By experimentation, I find that `===` works for regular expressions, class names, literal values, and even ranges, while `=~` only seems to return useful values for regular expressions. My question is: why would I ever use `=~`? It seems like `===` supports everything `=~` does and then some. Is there something I'm missing here that `=~` is intended to do differently?