Regexp and powershell
<p>I have a, probably, simple task that im trying to solve - so far without any success.
I want to use powershell to parse and match a string into variables.
The string is of the form</p>

<pre><code>"Message
-------
RECORDING XYZ started recording on 2016-11-08 19:58:03 and stopped on 2016-11-08 20:33:00 as scheduled."
</code></pre>

<p>and i want it to produce three variables $title = "RECORDING XYZ", $start_time = "2016-11-08 19:58:03", $stop_time = "2016-11-08 20:33:00".</p>

<p>Is regexp the way to go or does powershell has any simpler functions? ive been looking at -split and -match for ex.</p>

<p>Please does any one have to time to give me a hand?
Regards</p>

<hr>

<p>Edit:</p>

<p>Mathias answer lead me to this solution</p>

<pre><code>    $text = "Message
-------
RECORDING XYZ started recording on 2016-11-08 19:58:03 and stopped on 2016-11-08 20:33:00 as scheduled."

$lines = $text -split "\n"

$lines[2] -match "^(.+) started recording on (.+) and stopped on (.+) as scheduled."

Write-Output $Matches[1]
</code></pre>

<p>Simple but it works</p>