title: Write to file after match in Kotlin
body: <p>New to Kotlin, I'd like to insert a line in the file after a specific match in the file.  I know how to do this with sed like the following:</p>
  
  <pre><code>sed "/some line in file/a some text I'd like to add after line" file
  </code></pre>
  
  <p>But I'd like to understand how I'd go about this in Kotlin.  So far I've got got as far as the printWriter interface, but I don't see anything that clearly implies an offset or regex parameter.</p>
  
  <p>So far I've got:</p>
  
  <pre><code>File("file.txt").printWriter(...)
  </code></pre>
  
  <p>Thanks!</p>