Documentation
¶
Overview ¶
Package regexp ports Go's regexp package to google/go-jsonnet's native functions.
Example ¶
vm := jsonnet.MakeVM() vm.NativeFunction(regexp.MatchString("regexp.match")) code := `std.native("regexp.match")("l{2}", "hello")` result, err := vm.EvaluateAnonymousSnippet("test.jsonnet", code) if err != nil { log.Fatal(err) } var a []any if err := json.Unmarshal([]byte(result), &a); err != nil { log.Fatal(err) } fmt.Printf("%v %v\n", a[0], a[1])
Output: true <nil>
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchString ¶
func MatchString(name string) *jsonnet.NativeFunction
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.