From e78ccfebe42894f799b3c8d2f6c6392687914dfb Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Sat, 27 Mar 2021 12:05:13 -0700 Subject: [PATCH] Update SYNTAX.md --- SYNTAX.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/SYNTAX.md b/SYNTAX.md index 5ea0407..f0f0c29 100644 --- a/SYNTAX.md +++ b/SYNTAX.md @@ -77,14 +77,21 @@ 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. +You'll also need to make sure that the `\` character is correctly escaped when hardcoding a path in you 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 - +// Go +val := gjson.Get(json, "fav\\.movie") // must escape the slash +val := gjson.Get(json, `fav\.movie`) // no need to escape the slash ``` +```rust +// Rust +let val = gjson::get(json, "fav\\.movie") // must escape the slash +let val = gjson::get(json, r#"fav\.movie"#) // no need to escape the slash +``` + + ### Arrays The `#` character allows for digging into JSON Arrays.