title: Is it possible to detect code in String using Regex?
body: <p>For example : </p>
  
  <p>For the following Text:</p>
  
  <pre><code>Lorem ipsum dolor sit amet, eum ut vitae quidam mentitum, eu eum malorum eligendi tincidunt. Vix te vitae tamquam, mea nisl praesent ea, vis omnis postulant in
  
  import sys def fun(){print('Hello')} fun()
  
  Mea veri fierent explicari eu, ne appareat convenire mei. Dicat neglegentur definitiones nec id, sit facete cotidieque in. Intellegam referrentur cu cum, an mandamus periculis pro.
  </code></pre>
  
  <p>How can we use regex (or some other technique) to find if there is code in there or not). Code can be in java/python/C/css/js etc.</p>
  
  <p>(Also I observed while posting the question that if the code is not formatted properly, stack overflow raises a warning, any idea how is it getting done?)</p>