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

[feature] supporting lookarounds #2235

Open
pmiam opened this issue Sep 19, 2024 · 1 comment
Open

[feature] supporting lookarounds #2235

pmiam opened this issue Sep 19, 2024 · 1 comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. queries Filtering options, query arguments..

Comments

@pmiam
Copy link

pmiam commented Sep 19, 2024

I want to try adding support for regex lookarounds to the query engine. Their main use is to match transactions that contain specified tag values and no others.

As Simon pointed out to me in #2095 (comment)_ this functionality would be best achieved with negative lookaheads.

In that thread, I was able to abuse character classes to query for transactions containing postings tagged with different values sharing no letters in common. This is not a reliable nor intuitive method.

I've just started a fork of regex-tdfa with positive auspices from Andreas Abel where I'll try adding the necessary features upstream.

I'll use this issue to discuss details specific to hledger. This feature may need to become a separate dependency or hledger extension instead of enjoying upstream support, but I prefer to avoid that outcome.

@simonmichael simonmichael added A-WISH Some kind of improvement request, hare-brained proposal, or plea. queries Filtering options, query arguments.. labels Sep 24, 2024
@simonmichael
Copy link
Owner

Cool. I would welcome more power in regexes generally, especially if it can land in the maintained regex-tdfa.

On #2095 we could also explore the alternative of making hledger queries more powerful, if you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. queries Filtering options, query arguments..
Projects
None yet
Development

No branches or pull requests

2 participants