Go-Restructure: Sane regular expressions with struct fields
1–10 of 47 posts
Re: Go-Restructure: Sane regular expressions with struct fields
#2Very very very elegant approach to the problem. I know I'll be using it.
Re: Go-Restructure: Sane regular expressions with struct fields
#3Very very very elegant approach to the problem. I know I'll be using it.
Agreed, it minimizes the friction in going from regex to usable data structure more than any previous solution I've seen.
Really makes me appreciate the value of Go's field tags.
Re: Go-Restructure: Sane regular expressions with struct fields
#4Neat. It could adopt the key:"value" convention of other struct tag libraries (e.g. json:"name" xml:"name") to make it more composable.
Re: Go-Restructure: Sane regular expressions with struct fields
#5Very nice solution! I try to avoid using 3rd party libraries but this I would use without hesitation.
Some benchmarks would be interesting.
Re: Go-Restructure: Sane regular expressions with struct fields
#6Neat. It could adopt the key:"value" convention of other struct tag libraries (e.g. json:"name" xml:"name") to make it more composable.
[deleted]
Re: Go-Restructure: Sane regular expressions with struct fields
#7Neat. It could adopt the key:"value" convention of other struct tag libraries (e.g. json:"name" xml:"name") to make it more composable.
Agreed. I think "re" would be a good and succinct key. Or "regex" if you wanna go more explicit.
Re: Go-Restructure: Sane regular expressions with struct fields
#8Neat. It could adopt the key:"value" convention of other struct tag libraries (e.g. json:"name" xml:"name") to make it more composable.
Agreed. I think "re" would be a good and succinct key. Or "regex" if you wanna go more explicit.
Re: Go-Restructure: Sane regular expressions with struct fields
#9This is neat but I don't love what it does to struct definitions. Would a modified variant better make use of named capture groups?
Re: Go-Restructure: Sane regular expressions with struct fields
#10I wrote a quick C# port PoC: https://gist.github.com/benjamingr/4de21494b3e76088e5f7
Nice idea.