aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/parse/json.go
blob: d7486d0b13d21927d89467782ae64d8289191420 (plain)
1
2
3
4
5
6
7
8
9
10
package parse

import "regexp"

var jsonFormatRegex = regexp.MustCompile(`^\s*(json|{{\s*json\s*(\.)?\s*}})\s*$`)

// MatchesJSONFormat test CLI --format string to be a JSON request
func MatchesJSONFormat(s string) bool {
	return jsonFormatRegex.Match([]byte(s))
}