I'm trying to convert this Java regular expression to Go's regular expression syntax:
[:]?([\D&&[^/]]./)?(/|[\D&&[^/]][^/])
This regular expression is the regex for matching Clojure keywords, taken from the JVM Clojure compiler.
I'm trying to convert this Java regular expression to Go's regular expression syntax:
[:]?([\D&&[^/]]./)?(/|[\D&&[^/]][^/])
This regular expression is the regex for matching Clojure keywords, taken from the JVM Clojure compiler.
It should be
var pattern = regexp.MustCompile(`:?([^/\d].*/)?(/|[^\d/][^/]*)`)
The pattern [\D&&[^/]]
means any non-digit but a /
, and it can be expressed with an extended negated character class [^\d/]
.