title: Split array based on two delimiters using a regular expression and know the splitted character
body: <p>I want to separate a string based on <code>#</code> and <code>.</code> and put the substring into an associative array depending on which character it matched on.</p>
  
  <p>For example if I have:</p>
  
  <pre><code>"one#two.three"
  </code></pre>
  
  <p>I am trying to achieve:</p>
  
  <pre><code>e["none"] = "one";
  e["period"] = "two";
  e["hash"] = "three";
  </code></pre>
  
  <p>The main problem I have is I can't figure out how to tell if it matched on a <code>#</code> or <code>.</code>.</p>
  
  <p>I don't need to use a regular expression, I just assumed it would be the best way.</p>
  
  <p>EDIT: I am assuming that there will only be one of each. So the input:</p>
  
  <pre><code>one.two.three
  </code></pre>
  
  <p>would be invalid</p>