title: How to filter the string patterns to match in textlines with regex?
body: <p>I need match this regular expression pattern in the given text with python.</p>
  
  <p>The text is :</p>
  
  <pre><code>  """
  
         2010 Toyota FJ Cruiser FJ CRUISER
  
         Int. Color:
  
         Ext. Color:
  
         Black
  
         Trans:
  
         Automatic
  
         VIN:
  
          JTEZU4BF7AK009445  
  
  
        Stock:
  
        122821B
  
        DIFFERENTIALBLACK
  
       Status:
  
       Body Style: 
       SUV
       Engine:
       Gas V6 4.0L/241
                                               Dealership: Universal Toyota
  
  
  
      $29,988*
                                               Price
  
       View More Information
  
  
       Compare?
  
      """
  </code></pre>
  
  <p>From this text i need to extract "JTEZU4BF7AK009445" (length is 17) this pattern after vin: probably</p>
  
  <p>I used this pattern</p>
  
  <pre><code>        vin_pattern = re.compile('([A-Z0-9]{17})')
          vin = re.findall(vin_pattern,text)
  
          ["JTEZU4BF7AK009445","DIFFERENTIALBLACK"]
  </code></pre>
  
  <p>But <em>DIFFERENTIALBLACK</em> should not be matched</p>
  
  <p>As well as I used also the pattern</p>
  
  <pre><code>       price_pat = re.compile('(\$[0-9\,\.]+)')
  </code></pre>
  
  <p>to match the price range ("$"sign+value)</p>
  
  <p>Here I need to check this price matching pattern <strong>only before and after 50 characters</strong> of <strong>VIN_PATTERN</strong> appears.
  Because in some cases i have more price values.So, i need to filter the text before 50 characters and after 50 characters of that VIN pattern exists</p>
  
  <p>Plz How it should supposed to do?</p>