--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/d208fed7-dec3-8865-b332-1d693122edda%40hoi-polloi.org.
Hello, this is Jonathan, I can help you with your question about the error parsing regexp in Go.
The error you are getting is caused by the use of \w in your regular expression. This is an invalid escape sequence in Go, because \w is not a predefined character class1. Go only supports the following escape sequences in regular expressions2:
To match a word character in Go, you need to use [[:word:]], which is equivalent to [0-9A-Za-z_]. Alternatively, you can use [[:alnum:]]_, which is equivalent to [0-9A-Za-z]_. So, your regular expression should be:
regexp.Compile(`^([[:word:]./]+)/((?:[[:word:]]+)|[*])(.+)?$`)
or
regexp.Compile(`^([[:alnum:]_./]+)/((?:[[:alnum:]_]+)|[*])(.+)?$`)
This should fix the error and allow you to load the plugin successfully.
I hope this helps you with your problem. If you have any further questions, please feel free to ask. 😊