<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2023-04-26 12:56:06 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2023-04-26 12:56:06 +0100
commit4669d3cc24ebe445f49efece9f2dd7f292eb3058 (patch)
treeb926f10883160bc7be92d8a63cd07c03eccc3365 /README.md
parent7e698214ef723bba55da05fbb55c359e9bf33f76 (diff)
downloadstred-go-4669d3cc24ebe445f49efece9f2dd7f292eb3058.tar
Clarify part of the example in README
Diffstat (limited to 'README.md')
-rw-r--r--README.md1
1 files changed, 1 insertions, 0 deletions
diff --git a/README.md b/README.md
index 014c6c3..ec18831 100644
--- a/README.md
+++ b/README.md
@@ -86,6 +86,7 @@ We want to make sure we only count one of these, so we'll only be counting the s
For step 2.1.1, we again just use a path substitution, with `,` that represents any single JSON value (null, boolean, number or string): `S/,/`.
For step 2.1.2, we want to check that it is either a value `,` or the beginning of an array or object so we use ``s/,|[`{[`]/``.
+The `|` subex operator will try the subexes on both sides of it and `[]` are used to recognise one of several options, in this case the options are the start of an object and the start of an array.
Once again we will want to run all of the step 2.2 commands only if both of these checks pass, so we add some more curly brackets for the step 2.2 commands after them: ``S/,/s/,|[`{[`]/{}``.