Flags for ${...} syntax for re_interpolate#520
Merged
Conversation
Subsequent digits are treated as literal characters. So e.g. "\0123" means group \0 followed by literal "123".
Currently I'm supporting digits here only. In the future named groups would go here too.
7009a0b to
db6b634
Compare
Suggested by Leon, thanks.
db6b634 to
40382c0
Compare
cxreg
approved these changes
Jul 10, 2026
cxreg
left a comment
There was a problem hiding this comment.
This seems understandable and correct to me, thanks!
This was referenced Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exciting things I do here:
re_interpolate(), I decided I just like the shorter name. I'm keeping it in <re/groups.h> because I expect other groups-related things to land thereRE_INTERPOLATE_SINGLE_DIGITtreats subsequent digits after the first as literals. so e.g.\123means\1followed by a literal "23"RE_INTERPOLATE_BRACESallows for writing${11}1meaning group 11 followed by a literal "1"named captures would also go inside the
{...}syntax, but I don't want to introduce that yet.