I want to store each single, complete, multiline result of a pcregrep into a variable for each iteration of a for loop.
Ex:
for a in $(pcregrep -Moh 'regex_that_spans_multiple_lines'); do
blah
blah
done
However, I'm not sure what IFS I should use which would properly recognize each separate pcregrep result so I can store it into the variable (one result per iteration).
I'm also open to hear other round-about means of accomplishing the goal (even if it doesn't involve IFS)
Here are some sample results that I'd be working with:
Result 1:
new PDO(
$connectionString,
$this->options['user'],
$this->options['password'],
$this->options['driverOptions']
);
Result 2:
mysqli_connect(
$this->options['host'], $this->options['user'], $this->options['password'], null, $this->options['port'], $this->options['socket']
);
Thanks in advance