onLineMatching
Registers a handler that is triggered when a line matches the specified regex pattern. If no regex is provided, the handler will be called for every line.
Parameters
regex
The regex pattern to match against each line, or null to match any line
handler
The function to handle the matched line