title: Understanding these Regular Expressions
body: <p>There is a variable being set as follows (through custom tag invocation)</p>
  
  <pre><code>&lt;cfset str = Trim( THISTAG.GeneratedContent ) /&gt;
  </code></pre>
  
  <p>The contents of THISTAG.GeneratedContent looks like </p>
  
  <pre><code>FNAME|MNAME|LNAME Test|Test|Test
  </code></pre>
  
  <p>The code I am having trouble understanding is as follows:</p>
  
  <pre><code>&lt;cfset str = str.ReplaceAll(
              "(?m)^[\t ]+|[\t ]+$",
              ""
              ) /&gt;
  
  &lt;cfset arrRows = str.Split( "[\r\n]+" ) /&gt;
  </code></pre>
  
  <p>The above line of code should generate array with contents as </p>
  
  <pre><code>arrRows[1] = FNAME|MNAME|LNAME
  arrRows[2] = Test|Test|Test
  </code></pre>
  
  <p>But on dumping the array shows following output:</p>
  
  <pre><code>FNAME|MNAME|LNAME Test|Test|Test
  </code></pre>
  
  <p>I do not understand what both regular expressions are trying to achieve.</p>