title: How can pattern matching be done on text?
body: <p>Lets say that I want to pattern match against text. Specifically, I want to pattern match on the first letter.</p>
  
  <p>For example, how do I create a pattern that would match "about" and "analog" but not "beta"?</p>
  
  <p>I've tried this:</p>
  
  <pre><code>defmodule MatchStick do
      def doMatch([head | tail]) when head == "a" do 1 end
      def doMatch([head | tail]) do 0 end
  end
  
  res = MatchStick.doMatch("abcd");
  </code></pre>
  
  <p>I've also tried character lists:</p>
  
  <pre><code>defmodule MatchStick do
      def doMatch([head | tail]) when head == 'a' do 1 end
      def doMatch([head | tail]) do 0 end
  end
  
  res = MatchStick.doMatch('abcd');
  </code></pre>
  
  <p>Neither worked. What is the proper way to match text?</p>