Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline Regex handling multiple key-value pairs #5

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jsboak
Copy link

@jsboak jsboak commented Feb 11, 2022

This enhancement/fix allow for identifying multiple matches against the multi-line output. Example:
With raw, output of

Status:
Open 10
Closed 21
Pending 3

And a regex pattern of (\w+)\s(\d+), the data variables will now be:

$data.Open = 10
$data.Closed = 21
$data.Pending = 3

Screen Shot 2022-02-10 at 4 59 56 PM

@kjoyce77
Copy link

What am I missing here

Wouldn't going from this:
Matcher match = dataPattern.matcher(buffer.toString())

To this:
Matcher match = dataPattern.matcher(line)

turn this back into the key/value matcher we already have? And also break any multiline matches? If there are newlines in the value wouldn't it not see those?

@fdevans fdevans marked this pull request as draft July 20, 2022 20:07
@fdevans
Copy link

fdevans commented Jul 20, 2022

Moving this to draft. We need to ensure that we have ways to maintain backwards compatibility as part of this work. (If we move forward)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants