title: How do I match non-letters before my token?
body: <p>I'm using Ruby 2.4.  I'm massively confused about why my RegEx isn't working.  I want to match a token from my array provided the stuff right before it is not letters.  My array is</p>
  
  <pre><code>2.4.0 :023 &gt; GENDER_TOKENS
   =&gt; ["m", "male", "men", "f", "w", "female", "wom"]
  </code></pre>
  
  <p>So this should match</p>
  
  <pre><code>"2f 25"
  </code></pre>
  
  <p>as should </p>
  
  <pre><code>"f 100"
  </code></pre>
  
  <p>but not </p>
  
  <pre><code>"elf 25"
  </code></pre>
  
  <p>since the stuff before the "f" are not letters.  I thought this would do it ...</p>
  
  <pre><code>2.4.0 :021 &gt; data = "elf 25"
   =&gt; "elf 25"
  2.4.0 :022 &gt;  Regexp.new("(^|[^\p{L}]+)#{Regexp.union(GENDER_TOKENS)}").match(data.downcase)
   =&gt; #&lt;MatchData "elf" 1:"el"&gt;
  </code></pre>
  
  <p>But it's matching all the same.  Why sin't "^\p{L}]" matching non-letters?</p>