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

fix(KFLUXBUGS-1117): use FindAllStringSubmatch() to get ALL matches #22

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

dheerajodha
Copy link
Member

  • Currently, the FindStringSubmatch() returns the first Match and its Groups, ignoring the other matches.
  • This works fine if the first match is what we're interested in (the e2e test job's url), but regex won't match anything if it's the second match.
  • This commit instead uses FindAllStringSubmatch() to return ALL matches and their groups, and goes through them one by one to ignore the ones with string "images" or ")" in them.

@dheerajodha dheerajodha requested a review from psturc February 20, 2024 10:02
issue_comment.go Outdated Show resolved Hide resolved
* Currently, the `FindStringSubmatch()` returns the first Match and
  its Groups, ignoring the other matches.
* This works fine, if the first match is what we're interested in
  (the e2e test job's url), but it won't return anything if it's
  the second match.
* This commit instead uses `FindAllStringSubmatch()` to return ALL
  matches and their groups, and goes through them one by one to
  ignore the ones with string "images" or ")" in them.

Signed-off-by: Dheeraj<[email protected]>
@dheerajodha dheerajodha merged commit a4e36c3 into main Mar 15, 2024
7 checks passed
psturc pushed a commit that referenced this pull request Apr 17, 2024
)

* Currently, the `FindStringSubmatch()` returns the first Match and
  its Groups, ignoring the other matches.
* This works fine, if the first match is what we're interested in
  (the e2e test job's url), but it won't return anything if it's
  the second match.
* This commit instead uses `FindAllStringSubmatch()` to return ALL
  matches and their groups, and goes through them one by one to
  ignore the ones with string "images" or ")" in them.

Signed-off-by: Dheeraj<[email protected]>
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.

2 participants