# Named Capture Group to create new columns

**URL:** <https://discourse.julialang.org/t/named-capture-group-to-create-new-columns/65997>\
**Category:** New to Julia\
**Tags:** dataframes\
**Created:** [August 7, 2021, 7:48pm UTC](https://discourse.julialang.org/t/named-capture-group-to-create-new-columns/65997 "2021-08-07T19:48:01Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [August 8, 2021, 12:23am UTC](https://discourse.julialang.org/t/named-capture-group-to-create-new-columns/65997/3 "2021-08-08T00:23:55Z")

</div>

Here is the code to create a Tables.jl table (compatible with DataFrames)  
With columns based on regex named captures.

> [@Creating a Table from Regex](https://discourse.julialang.org/t/creating-a-table-from-regex/63201):
>
> It occurred to me that it would be nice to be able to create a table from a string by providing a regex that uses named groups. nushell’s parse function ([docs](https://www.nushell.sh/book/commands/parse.html), [example](https://www.nushell.sh/cookbook/parsing.html)) does this. A RegexMatch has all the right things for a Tables.jl row, except it doesn’t provide getproperty overloads as historically it’s fields were part of it’s public API (though that has progressively become less true, it would be too breaking to change that now). But we can wrap a RegexMatch in a suitable type. (Might a…

Not sure if that is useful to you.

---

_[View the full topic](https://discourse.julialang.org/t/named-capture-group-to-create-new-columns/65997)._
