title: Matching exact strings in python
body: <p>How can I match exact strings in Python which can dynamically catch/ignore the following cases?</p>
  
  <p>If I want to get value2 in this IE output "Y" from a file that is formatted as such:</p>
  
  <pre><code>...
  --value1 X
  ---value2 Y
  ----value3 Z
  ....
  </code></pre>
  
  <p>How can I search for the exact match "value2" whilst ignoring the preceding "---", these characters don't allow exact string matching with the "==" operator when searching each line.</p>