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

Support a rewrite syntax with form \g{n} to allow for integers to follow #463

Merged
merged 2 commits into from
Sep 28, 2024

Conversation

cbowman0
Copy link
Contributor

Here's a proposed solution to fix #462.

@grobian
Copy link
Owner

grobian commented Sep 27, 2024

ehhh, sweet! Thanks a lot!

Just one question, where does the \g come from? I'm not familiar with it, is it used with sed or something?

@grobian
Copy link
Owner

grobian commented Sep 27, 2024

Oh, and since you added tests and all for completeness, could you update the configuration syntax docu too?

@grobian
Copy link
Owner

grobian commented Sep 27, 2024

and please add Signed-off-by tag to your commit

@cbowman0
Copy link
Contributor Author

The \g{n} syntax comes from the Backreference section of the libpcre man pages: https://pcre.org/pcre.txt

BACKREFERENCES

         \n              reference by number (can be ambiguous)
         \gn             reference by number
         \g{n}           reference by number
         \g{-n}          relative reference by number
         \k<name>        reference by name (Perl)
         \k'name'        reference by name (Perl)
         \g{name}        reference by name (Perl)
         \k{name}        reference by name (.NET)
         (?P=name)       reference by name (Python)

I'm not tied to it. It was what I found when attempting to solve our problem before realizing that carbon-c-relay doesn't use the regex library to do the substitution. The syntax can be anything that successfully allows the replacement =)

@grobian
Copy link
Owner

grobian commented Sep 27, 2024

No this is fine, principle of least surprise I suppose. Please add the docu and Signoff so I can merge, thanks!

Signed-off-by: Christopher Bowman <cbowman0@gmail.com>
@cbowman0
Copy link
Contributor Author

Did I update the carbon-c-relay.md properly? Any feedback on the wording or format?

@grobian
Copy link
Owner

grobian commented Sep 28, 2024

can you wrap the doc at at most 80 chars please, apart from that looks perfectly fine to me

@grobian
Copy link
Owner

grobian commented Sep 28, 2024

I actually meant only your changes, but this is fine too, thanks!

@grobian grobian merged commit 5011a2c into grobian:master Sep 28, 2024
grobian added a commit that referenced this pull request Sep 28, 2024
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
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.

Aggregate compute rule with integer following group match
2 participants