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

Match of specific item (of multiple matches) fails #63

Open
th4git opened this issue May 9, 2022 · 2 comments
Open

Match of specific item (of multiple matches) fails #63

th4git opened this issue May 9, 2022 · 2 comments
Labels

Comments

@th4git
Copy link

th4git commented May 9, 2022

General assumption
The matched portions of the input text should be selectable via item-counter to adress each matched portion by its match count.
See https://regex101.com/r/1nRZmi/1 for an example with regex
This (domain) is for use in (\w+) examples
with input from the website www.example.com

<body>
<div>
    <h1>Example Domain</h1>
    <p>This domain is for use in illustrative examples in documents. You may use this
    domain in literature without prior coordination or asking for permission.</p>
    <p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>

which leads to the matches

Match 1 | This domain is for use in illustrative examples
Group 1 | domain
Group 2 | illustrative

Describe the bug
The parser-adapter only allows to select the first matched group from example above via item == 0.
Additional group matches (adressing with item >= 1) deliever an empty match. The complete match is not adressable, too.

By the way: Even negative values for item-number can by entered, which makes no sense here and should be prevented.

To Reproduce
image

image

Expected behavior
All matches of a regexp should be addressable via item-counter. If the behaviour would be aligned with that of website regex101.com, there should be three matches at the example from above:

Item 0 | Match 1 | This domain is for use in illustrative examples
Item 1 | Group 1 | domain
Item 2 | Group 2 | illustrative

But at least all group matches should be addressable (not only the first one) .

Maybe there is an overlap with bug #42 and a relation to feature request #40 (@Apollon77).

Versions:

  • Adapter version: v1.1.5
  • JS-Controller version: v4.0.15
  • Node version: v16.14.0
  • Operating system: Debian GNU/Linux 10 (buster)
@th4git th4git changed the title Match of specific item (matched group) fails Match of specific item (of multiple matches) fails May 9, 2022
@stale
Copy link

stale bot commented Sep 21, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions.
Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

@stale stale bot added the wontfix label Sep 21, 2022
@Apollon77 Apollon77 removed the wontfix label Dec 9, 2022
@GermanBluefox
Copy link
Contributor

Why just not use This domain is for use in (\w+) examples as regex if you want to get second group anyway?

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

No branches or pull requests

3 participants