diff --git a/SYNTAX.md b/SYNTAX.md index 9558019..5ea0407 100644 --- a/SYNTAX.md +++ b/SYNTAX.md @@ -77,6 +77,14 @@ Special purpose characters, such as `.`, `*`, and `?` can be escaped with `\`. fav\.movie "Deer Hunter" ``` +You'll also need to make sure that the `\` character is correctly escaped when hardcoding a path in source code. + +```go +res := gjson.Get(json, "fav\\.movie") // must escape the slash +res := gjson.Get(json, `fav\.movie`) // no need to escape the slash + +``` + ### Arrays The `#` character allows for digging into JSON Arrays.