Getting Started with Elixir - Pattern Matching

We discussed the = operator in the previous section where we used it to assign a value to a variable. But in Elixir it's actually called the match operator because it has a powerful feature built into it that that enables us to perform what is known as "Pattern Matching".

Pattern Matching is used almost as often as functions in Elixir which makes it an important core feature to utilize in your programs.

Pattern Matching is the act of checking a given sequence of tokens for the presence of the constituents of some pattern.

A slightly cryptic definition, but we can break this down using some examples.

Ensure you have Elixir and IEx installed to follow along and test the examples.

Elixir Series

Connect

I hope you're finding this series helpful. If you find any issues or have any feedback feel free to hit me up on twitter: @tmartin8080 || @phxroad or subscribe to the mailing list to receive occasional updates.