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