title: How do I parse a YAML file in groovy?
body: <p>say if you have a file called <code>example.yaml</code> which contains the following:
  <code>- subject: maths</code>.</p>
  
  <p>How do i grab the string after <code>- subject</code>?</p>
  
  <p>I already can read the contents of the file but want to know how to grab a specific string from it.</p>
  
  <p>note: i know regex may help but have never used it and would appreciate any help.</p>