Skip to content

Flags for ${...} syntax for re_interpolate#520

Merged
katef merged 5 commits into
mainfrom
kate/re-interpolate
Jul 10, 2026
Merged

Flags for ${...} syntax for re_interpolate#520
katef merged 5 commits into
mainfrom
kate/re-interpolate

Conversation

@katef

@katef katef commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Exciting things I do here:

  • rename to 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 there
  • RE_INTERPOLATE_SINGLE_DIGIT treats subsequent digits after the first as literals. so e.g. \123 means \1 followed by a literal "23"
  • RE_INTERPOLATE_BRACES allows for writing ${11}1 meaning group 11 followed by a literal "1"

named captures would also go inside the {...} syntax, but I don't want to introduce that yet.

katef added 4 commits July 9, 2026 11:51
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.
@katef katef force-pushed the kate/re-interpolate branch from 7009a0b to db6b634 Compare July 10, 2026 14:33
Suggested by Leon, thanks.
@katef katef force-pushed the kate/re-interpolate branch from db6b634 to 40382c0 Compare July 10, 2026 14:38

@june-fastly june-fastly left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@cxreg cxreg left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems understandable and correct to me, thanks!

@katef katef merged commit 74f34b3 into main Jul 10, 2026
346 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants