As the comment says, it
"Try to retrieve matching lines if the content-text is set to 1"
The first 5 matched lines (if any) are found out and combined together to the result string "$extract", the re-exp pattern is defined by "$reg_strings".
But this code should modified to consider the case of EOF as there may be not more than 4 matched lines.