summaryrefslogtreecommitdiff
path: root/cmd/podman/parse/json.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/parse/json.go')
-rw-r--r--cmd/podman/parse/json.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/podman/parse/json.go b/cmd/podman/parse/json.go
new file mode 100644
index 000000000..95a6633b8
--- /dev/null
+++ b/cmd/podman/parse/json.go
@@ -0,0 +1,9 @@
+package parse
+
+import "regexp"
+
+var jsonFormatRegex = regexp.MustCompile(`^(\s*json\s*|\s*{{\s*json\s*\.\s*}}\s*)$`)
+
+func MatchesJSONFormat(s string) bool {
+ return jsonFormatRegex.Match([]byte(s))
+}