summaryrefslogtreecommitdiff
path: root/cmd/podman/parse/json.go
blob: 85572a057016f1eea194d543323282f86a652d11 (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))
}