# Does Regex.replace support named captures?

**URL:** <https://forum.elixirforum.com/t/does-regex-replace-support-named-captures/60718>\
**Category:** Questions\
**Tags:** syntax, regex\
**Created:** [January 2, 2024, 10:56am UTC](https://forum.elixirforum.com/t/does-regex-replace-support-named-captures/60718 "2024-01-02T10:56:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![krasenyp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/krasenyp/32/39733_2.png) [@krasenyp](https://forum.elixirforum.com/u/krasenyp)\
**Post date:** [January 2, 2024, 11:35am UTC](https://forum.elixirforum.com/t/does-regex-replace-support-named-captures/60718/2 "2024-01-02T11:35:45Z")

</div>

I don’t think such replacements is supported. You can see the source [here](https://github.com/elixir-lang/elixir/blob/v1.16.0/lib/elixir/lib/regex.ex#L740). It explicitly matches an integer after `\\g{`.

---

_[View the full topic](https://forum.elixirforum.com/t/does-regex-replace-support-named-captures/60718)._
