title: How to detect source code in a text?
body: <p>Is it possible to detect a programming language source code (primarily Java and C# ) in a text?</p>
  
  <p>For example I want to know  whether there is any source code part in this text.</p>
  
  <pre><code>.. text text text text text text text text text
  text text text text text text text text text
  text text text text text text text text text
  
  public static Person createInstance() { return new Person();}
  
  text text text text text text text text text
  text text text text text text text text text
  text text text text text text text text text ..
  </code></pre>
  
  <p>I have been searching this for a while and I couldn't find anything.</p>
  
  <p>A solution with Python would be wonderful.</p>
  
  <p>Regards.</p>