On Wednesday, 26 January 2022 at 04:51:04 UTC rol...@gmail.com wrote: > The tool you are looking for is most probably the regex module: > > https://pkg.go.dev/regexp >
"Then you have two problems" :-) But it could be reasonable here if the format is fixed. If this is a true multi-valued column in postgres, such as an array type <https://www.postgresql.org/docs/12/arrays.html>, then I would be trying to get the postgres API to return this to me in a structured way, e.g. see here <https://www.opsdash.com/blog/postgres-arrays-golang.html>. If this is just a string field which happens to contain the text "(foo,bar)" then this is a custom serialization of your data, and you'll have to parse this custom format yourself. I'd be thinking "what should happen if the parentheses are missing? How does this format represent a value which contains a comma or contains a parenthesis?" -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/3174cc7c-71d7-4287-bd42-afa2d9bccbe0n%40googlegroups.com.