title: Token Parsing Error: Lexical error
body: <p>I am getting the following error when I use a BeanshellPostProcessor to regex some data and write to file:</p>
  
  <pre><code>2015/06/11 12:11:19 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval   Sourced file: inline evaluation of: ``    import java.io.FileOutputStream;     import java.util.Map;     import java.u . . . '' Token Parsing Error: Lexical error at line 10, column 45.  Encountered: "d" (100), after : "\"c:\\" 
  2015/06/11 12:11:19 WARN  - jmeter.extractor.BeanShellPostProcessor: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval   Sourced file: inline evaluation of: ``    import java.io.FileOutputStream;     import java.util.Map;     import java.u . . . '' Token Parsing Error: Lexical error at line 10, column 45.  Encountered: "d" (100), after : "\"c:\\" 
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>import java.io.FileOutputStream;
  import java.util.Map;
  import java.util.Set;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.regex.*;
  
  String entirePage = new String(data);
  
  FileWriter fstream = new FileWriter("c:\\downloads\\results.txt",true);
  BufferedWriter out = new BufferedWriter(fstream);
  
  Pattern totalNetValue = Pattern.compile("totalNetValue\"&gt;([^\"]+)&lt;/span&gt;");
  
  Matcher mTotalNetValue = totalNetValue.matcher(entirePage);
      mTotalNetValue.find();
  //out.write(${date});
      out.write(mTotalNetValue.group(1));
  out.write("\n");
  
  out.close();
  </code></pre>
  
  <p>Any ideas what's wrong with my code? Thanks :-)</p>