Open VincentSchmid opened 5 months ago
Pkl's regexes follow Java syntax. They don't map 1:1 to Go regex, which is why they don't get turned into Go's regexp.Regexp
.
The pkl#Regex
struct exists for compatibility sake, but it's not really meant to represent config data.
I'd actually suggest that you represent regexes as strings in Pkl if you mean to pass it into Go. You can add a @SourceCode
annotation to get language injection in pkl-intellij:
@SourceCode { language = "RegExp" }
myRegex: String
It would be nice to have the Regex type convert to the regexp.Regexp type. Currently, I use a string and have to turn the string into regex within go before using it.