On Sat, Nov 5, 2016 at 2:51 PM, Tong Sun <suntong...@gmail.com> wrote: > The dark voodoo regexp as described here works for many cases. > http://www.perlmonks.org/?node_id=261292 > > But I did found its own limits when trying more samples...
Regular expression are, well, regular. This means that they can parse regular grammras, but can't parse context free grammars (like XML). It is actually impossible to use a regex to do this task; it will always be fragile, unfortunately. If you need to deal with more complicated namespaces like this, I'm afraid the encoding/xml package won't be able to do it either (see https://github.com/golang/go/issues/13400 and the many other open bugs about the issues). It's just not properly supported. Good luck! Best, Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- 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. For more options, visit https://groups.google.com/d/optout.