mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 16:35:45 +00:00
Still an unknown number remains but I am running out of patience. Adding dots is not the best use of my time. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
10 lines
266 B
Go
10 lines
266 B
Go
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))
|
|
}
|