Skip to content

Commit

Permalink
Merge pull request #155 from Prithvipal/master
Browse files Browse the repository at this point in the history
Fixed syntax document for escape character
  • Loading branch information
tidwall authored Feb 22, 2020
2 parents 0360deb + 1879ad9 commit c041e47
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions SYNTAX.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c041e47

Please sign in to comment.