diff options
-rw-r--r-- | manual/index.html | 298 |
1 files changed, 186 insertions, 112 deletions
diff --git a/manual/index.html b/manual/index.html index a3ff09fe..7d2ebc8d 100644 --- a/manual/index.html +++ b/manual/index.html @@ -417,23 +417,31 @@ particular version of jq has converted it to an IEEE754 double-precision representation, losing precision.</p> <p>The way in which jq handles numbers has changed over time and further changes are likely within the parameters set by -the relevant JSON standards. The following remarks are -therefore offered with the understanding that they are -intended to be descriptive of the current version of jq and -should not be interpreted as being prescriptive:</p> +the relevant JSON standards. Moreover, build configuration +options can alter how jq processes numbers.</p> +<p>The following remarks are therefore offered with the +understanding that they are intended to be descriptive of the +current version of jq and should not be interpreted as being +prescriptive:</p> <p>(1) Any arithmetic operation on a number that has not already been converted to an IEEE754 double precision representation will trigger a conversion to the IEEE754 representation.</p> <p>(2) jq will attempt to maintain the original decimal -precision of number literals, but in expressions such -<code>1E1234567890</code>, precision will be lost if the exponent is -too large.</p> +precision of number literals (if the <code>--disable-decnum</code> +build configuration option was not used), but in expressions +such <code>1E1234567890</code>, precision will be lost if the exponent +is too large.</p> <p>(3) In jq programs, a leading minus sign will trigger the conversion of the number to an IEEE754 representation.</p> <p>(4) Comparisons are carried out using the untruncated big decimal representation of numbers if available, as illustrated in one of the following examples.</p> +<p>The examples below use the builtin function <code>have_decnum</code> in +order to demonstrate the expected effects of using / not +using the <code>--disable-decnum</code> build configuration option, and +also to allow automated tests derived from these examples to +pass regardless of whether that option is used.</p> <div class="pb-3"> <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example1" aria-expanded="false" aria-controls="example1"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples @@ -478,7 +486,7 @@ illustrated in one of the following examples.</p> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> - <td class="font-monospace">jq '[., tojson]'</td> + <td class="font-monospace">jq '[., tojson] | . == if have_decnum then [12345678909876543212345,"12345678909876543212345"] else [12345678909876543000000,"12345678909876543000000"] end'</td> </tr> <tr> <th>Input</th> @@ -486,10 +494,10 @@ illustrated in one of the following examples.</p> </tr> <tr> <th>Output</th> - <td class="font-monospace">[12345678909876543212345,"12345678909876543212345"]</td> + <td class="font-monospace">true</td> </tr> <tr class="d-print-none"> - <th><a href="https://jqplay.org/jq?q=%5B.%2C%20tojson%5D&j=12345678909876543212345" class="btn btn-outline-primary btn-sm" target="_blank" rel="noopener">Run<span class="bi bi-box-arrow-up-right ms-2" aria-hidden="true"></span></a></th> + <th><a href="https://jqplay.org/jq?q=%5B.%2C%20tojson%5D%20%7C%20.%20%3D%3D%20if%20have_decnum%20then%20%5B12345678909876543212345%2C%2212345678909876543212345%22%5D%20else%20%5B12345678909876543000000%2C%2212345678909876543000000%22%5D%20end&j=12345678909876543212345" class="btn btn-outline-primary btn-sm" target="_blank" rel="noopener">Run<span class="bi bi-box-arrow-up-right ms-2" aria-hidden="true"></span></a></th> <td></td> </tr> </table> @@ -514,7 +522,7 @@ illustrated in one of the following examples.</p> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> - <td class="font-monospace">jq 'map([., . == 1]) | tojson'</td> + <td class="font-monospace">jq 'map([., . == 1]) | tojson | . == if have_decnum then "[[1,true],[1.000,true],[1.0,true],[1.00,true]]" else "[[1,true],[1,true],[1,true],[1,true]]" end'</td> </tr> <tr> <th>Input</th> @@ -522,17 +530,17 @@ illustrated in one of the following examples.</p> </tr> <tr> <th>Output</th> - <td class="font-monospace">"[[1,true],[1.000,true],[1.0,true],[1.00,true]]"</td> + <td class="font-monospace">true</td> </tr> <tr class="d-print-none"> - <th><a href="https://jqplay.org/jq?q=map%28%5B.%2C%20.%20%3D%3D%201%5D%29%20%7C%20tojson&j=%5B1%2C%201.000%2C%201.0%2C%20100e-2%5D" class="btn btn-outline-primary btn-sm" target="_blank" rel="noopener">Run<span class="bi bi-box-arrow-up-right ms-2" aria-hidden="true"></span></a></th> + <th><a href="https://jqplay.org/jq?q=map%28%5B.%2C%20.%20%3D%3D%201%5D%29%20%7C%20tojson%20%7C%20.%20%3D%3D%20if%20have_decnum%20then%20%22%5B%5B1%2Ctrue%5D%2C%5B1.000%2Ctrue%5D%2C%5B1.0%2Ctrue%5D%2C%5B1.00%2Ctrue%5D%5D%22%20else%20%22%5B%5B1%2Ctrue%5D%2C%5B1%2Ctrue%5D%2C%5B1%2Ctrue%5D%2C%5B1%2Ctrue%5D%5D%22%20end&j=%5B1%2C%201.000%2C%201.0%2C%20100e-2%5D" class="btn btn-outline-primary btn-sm" target="_blank" rel="noopener">Run<span class="bi bi-box-arrow-up-right ms-2" aria-hidden="true"></span></a></th> <td></td> </tr> </table> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> - <td class="font-monospace">jq '. as $big | [$big, $big + 1] | map(. > 10000000000000000000000000000000)'</td> + <td class="font-monospace">jq '. as $big | [$big, $big + 1] | map(. > 10000000000000000000000000000000) | . == if have_decnum then [true, false] else [false, false] end'</td> </tr> <tr> <th>Input</th> @@ -540,10 +548,10 @@ illustrated in one of the following examples.</p> </tr> <tr> <th>Output</th> - <td class="font-monospace">[true, false]</td> + <td class="font-monospace">true</td> </tr> <tr class="d-print-none"> - <th><a href="https://jqplay.org/jq?q=.%20as%20%24big%20%7C%20%5B%24big%2C%20%24big%20%2B%201%5D%20%7C%20map%28.%20%3E%2010000000000000000000000000000000%29&j=10000000000000000000000000000001" class="btn btn-outline-primary btn-sm" target="_blank" rel="noopener">Run<span class="bi bi-box-arrow-up-right ms-2" aria-hidden="true"></span></a></th> + <th><a href="https://jqplay.org/jq?q=.%20as%20%24big%20%7C%20%5B%24big%2C%20%24big%20%2B%201%5D%20%7C%20map%28.%20%3E%2010000000000000000000000000000000%29%20%7C%20.%20%3D%3D%20if%20have_decnum%20then%20%5Btrue%2C%20false%5D%20else%20%5Bfalse%2C%20false%5D%20end&j=10000000000000000000000000000001" class="btn btn-outline-primary btn-sm" target="_blank" rel="noopener">Run<span class="bi bi-box-arrow-up-right ms-2" aria-hidden="true"></span></a></th> <td></td> </tr> </table> @@ -4432,6 +4440,52 @@ ends with it.</p> </div> </div> </section> + <section id="trim-ltrim-rtrim"> + <h3> + <code>trim</code>, <code>ltrim</code>, <code>rtrim</code> + <a href="#trim-ltrim-rtrim" class="icon-link" aria-label="Link to this section: `trim`, `ltrim`, `rtrim`"><span class="bi bi-link-45deg" aria-hidden="true"></span></a> + </h3> + <p><code>trim</code> trims both leading and trailing whitespace.</p> +<p><code>ltrim</code> trims only leading (left side) whitespace.</p> +<p><code>rtrim</code> trims only trailing (right side) whitespace.</p> +<p>Whitespace characters are the usual <code>" "</code>, <code>"\n"</code> <code>"\t"</code>, <code>"\r"</code> +and also all characters in the Unicode character database with the +whitespace property. Note that what considers whitespace might +change in the future.</p> + <div class="pb-3"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example61" aria-expanded="false" aria-controls="example61"> + <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Example + </button> + <div id="example61" class="collapse mx-3 small d-print-block"> + <table class="table table-borderless table-sm w-auto"> + <tr> + <th class="pe-3">Command</th> + <td class="font-monospace">jq 'trim, ltrim, rtrim'</td> + </tr> + <tr> + <th>Input</th> + <td class="font-monospace">" abc "</td> + </tr> + <tr> + <th>Output</th> + <td class="font-monospace">"abc"</td> + </tr> + <tr> + <th></th> + <td class="font-monospace">"abc "</td> + </tr> + <tr> + <th></th> + <td class="font-monospace">" abc"</td> + </tr> + <tr class="d-print-none"> + <th><a href="https://jqplay.org/jq?q=trim%2C%20ltrim%2C%20rtrim&j=%22%20abc%20%22" class="btn btn-outline-primary btn-sm" target="_blank" rel="noopener">Run<span class="bi bi-box-arrow-up-right ms-2" aria-hidden="true"></span></a></th> + <td></td> + </tr> + </table> + </div> + </div> + </section> <section id="explode"> <h3> <code>explode</code> @@ -4440,10 +4494,10 @@ ends with it.</p> <p>Converts an input string into an array of the string's codepoint numbers.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example61" aria-expanded="false" aria-controls="example61"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example62" aria-expanded="false" aria-controls="example62"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Example </button> - <div id="example61" class="collapse mx-3 small d-print-block"> + <div id="example62" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -4472,10 +4526,10 @@ codepoint numbers.</p> </h3> <p>The inverse of explode.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example62" aria-expanded="false" aria-controls="example62"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example63" aria-expanded="false" aria-controls="example63"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Example </button> - <div id="example62" class="collapse mx-3 small d-print-block"> + <div id="example63" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -4506,10 +4560,10 @@ codepoint numbers.</p> <p><code>split</code> can also split on regex matches when called with two arguments (see the regular expressions section below).</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example63" aria-expanded="false" aria-controls="example63"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example64" aria-expanded="false" aria-controls="example64"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Example </button> - <div id="example63" class="collapse mx-3 small d-print-block"> + <div id="example64" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -4544,10 +4598,10 @@ returns said input string.</p> Null values are treated as empty strings. Arrays and objects in the input are not supported.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example64" aria-expanded="false" aria-controls="example64"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example65" aria-expanded="false" aria-controls="example65"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example64" class="collapse mx-3 small d-print-block"> + <div id="example65" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -4595,10 +4649,10 @@ in the input are not supported.</p> <p>Emit a copy of the input string with its alphabetic characters (a-z and A-Z) converted to the specified case.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example65" aria-expanded="false" aria-controls="example65"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example66" aria-expanded="false" aria-controls="example66"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Example </button> - <div id="example65" class="collapse mx-3 small d-print-block"> + <div id="example66" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -4632,10 +4686,10 @@ recursive jq function. Recursive calls within <code>while</code> will not consume additional memory if <code>update</code> produces at most one output for each input. See advanced topics below.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example66" aria-expanded="false" aria-controls="example66"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example67" aria-expanded="false" aria-controls="example67"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Example </button> - <div id="example66" class="collapse mx-3 small d-print-block"> + <div id="example67" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -4669,10 +4723,10 @@ recursive jq function. Recursive calls within <code>repeat</code> will not consume additional memory if <code>exp</code> produces at most one output for each input. See advanced topics below.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example67" aria-expanded="false" aria-controls="example67"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example68" aria-expanded="false" aria-controls="example68"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Example </button> - <div id="example67" class="collapse mx-3 small d-print-block"> + <div id="example68" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -4708,10 +4762,10 @@ recursive jq function. Recursive calls within <code>until()</code> will not consume additional memory if <code>next</code> produces at most one output for each input. See advanced topics below.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example68" aria-expanded="false" aria-controls="example68"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example69" aria-expanded="false" aria-controls="example69"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Example </button> - <div id="example68" class="collapse mx-3 small d-print-block"> + <div id="example69" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -4768,10 +4822,10 @@ could write <code>recurse(.+1; true)</code>.</p> memory whenever <code>f</code> produces at most a single output for each input.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example69" aria-expanded="false" aria-controls="example69"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example70" aria-expanded="false" aria-controls="example70"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example69" class="collapse mx-3 small d-print-block"> + <div id="example70" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -4878,10 +4932,10 @@ array of arrays before processing the array itself. The second example shows how all the keys of all the objects within the input can be considered for alteration.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example70" aria-expanded="false" aria-controls="example70"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example71" aria-expanded="false" aria-controls="example71"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example70" class="collapse mx-3 small d-print-block"> + <div id="example71" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -4921,6 +4975,23 @@ input can be considered for alteration.</p> </div> </div> </section> + <section id="have_literal_numbers"> + <h3> + <code>have_literal_numbers</code> + <a href="#have_literal_numbers" class="icon-link" aria-label="Link to this section: `have_literal_numbers`"><span class="bi bi-link-45deg" aria-hidden="true"></span></a> + </h3> + <p>This builtin returns true if jq's build configuration +includes support for preservation of input number literals.</p> + </section> + <section id="have_decnum"> + <h3> + <code>have_decnum</code> + <a href="#have_decnum" class="icon-link" aria-label="Link to this section: `have_decnum`"><span class="bi bi-link-45deg" aria-hidden="true"></span></a> + </h3> + <p>This builtin returns true if jq was built with "decnum", +which is the current literal number preserving numeric +backend implementation for jq.</p> + </section> <section id="$jq_build_configuration"> <h3> <code>$JQ_BUILD_CONFIGURATION</code> @@ -4946,10 +5017,10 @@ set when the jq program started.</p> <p>At the moment there is no builtin for setting environment variables.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example71" aria-expanded="false" aria-controls="example71"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example72" aria-expanded="false" aria-controls="example72"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example71" class="collapse mx-3 small d-print-block"> + <div id="example72" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -4997,10 +5068,10 @@ variables.</p> <p>Transpose a possibly jagged matrix (an array of arrays). Rows are padded with nulls so the result is always rectangular.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example72" aria-expanded="false" aria-controls="example72"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example73" aria-expanded="false" aria-controls="example73"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Example </button> - <div id="example72" class="collapse mx-3 small d-print-block"> + <div id="example73" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -5036,10 +5107,10 @@ after the insertion of x at ix. If the array is not sorted, <code>bsearch(x)</code> will return an integer that is probably of no interest.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example73" aria-expanded="false" aria-controls="example73"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example74" aria-expanded="false" aria-controls="example74"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example73" class="collapse mx-3 small d-print-block"> + <div id="example74" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -5106,10 +5177,10 @@ interest.</p> after a backslash. Whatever the expression returns will be interpolated into the string.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example74" aria-expanded="false" aria-controls="example74"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example75" aria-expanded="false" aria-controls="example75"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Example </button> - <div id="example74" class="collapse mx-3 small d-print-block"> + <div id="example75" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -5141,10 +5212,10 @@ or parse JSON texts into values, respectively. The <code>tojson</code> builtin differs from <code>tostring</code> in that <code>tostring</code> returns strings unmodified, while <code>tojson</code> encodes strings as JSON strings.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example75" aria-expanded="false" aria-controls="example75"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example76" aria-expanded="false" aria-controls="example76"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example75" class="collapse mx-3 small d-print-block"> + <div id="example76" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -5275,10 +5346,10 @@ literal will be escaped. For instance,</p> <p>Note that the slashes, question mark, etc. in the URL are not escaped, as they were part of the string literal.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example76" aria-expanded="false" aria-controls="example76"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example77" aria-expanded="false" aria-controls="example77"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example76" class="collapse mx-3 small d-print-block"> + <div id="example77" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -5406,10 +5477,10 @@ in typical C library documentation. The format string for ISO some systems. In particular, the <code>%u</code> and <code>%j</code> specifiers for <code>strptime(fmt)</code> are not supported on macOS.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example77" aria-expanded="false" aria-controls="example77"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example78" aria-expanded="false" aria-controls="example78"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example77" class="collapse mx-3 small d-print-block"> + <div id="example78" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -5536,10 +5607,10 @@ is irrelevant. If you're coming from JavaScript, please note that jq's <code>== JavaScript's <code>===</code>, the "strict equality" operator.</p> <p>!= is "not equal", and 'a != b' returns the opposite value of 'a == b'</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example78" aria-expanded="false" aria-controls="example78"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example79" aria-expanded="false" aria-controls="example79"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example78" class="collapse mx-3 small d-print-block"> + <div id="example79" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -5631,10 +5702,10 @@ once for each result that is not false or null, and <code>C</code> is evaluated once for each false or null.</p> <p>More cases can be added to an if using <code>elif A then B</code> syntax.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example79" aria-expanded="false" aria-controls="example79"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example80" aria-expanded="false" aria-controls="example80"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Example </button> - <div id="example79" class="collapse mx-3 small d-print-block"> + <div id="example80" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -5673,10 +5744,10 @@ to, less than or equal to or less than their right argument (respectively).</p> <p>The ordering is the same as that described for <code>sort</code>, above.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example80" aria-expanded="false" aria-controls="example80"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example81" aria-expanded="false" aria-controls="example81"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Example </button> - <div id="example80" class="collapse mx-3 small d-print-block"> + <div id="example81" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -5720,10 +5791,10 @@ than the common Perl/Python/Ruby idiom of form of "or", picking between two values rather than evaluating a condition, see the <code>//</code> operator below.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example81" aria-expanded="false" aria-controls="example81"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example82" aria-expanded="false" aria-controls="example82"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example81" class="collapse mx-3 small d-print-block"> + <div id="example82" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -5848,10 +5919,10 @@ generator of three values, and since it produces a value other <code>false</code> and <code>null</code>, the default <code>42</code> is not produced.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example82" aria-expanded="false" aria-controls="example82"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example83" aria-expanded="false" aria-controls="example83"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example82" class="collapse mx-3 small d-print-block"> + <div id="example83" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -5965,10 +6036,10 @@ if any, is output as if it had been the output of the expression to try.</p> <p>The <code>try EXP</code> form uses <code>empty</code> as the exception handler.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example83" aria-expanded="false" aria-controls="example83"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example84" aria-expanded="false" aria-controls="example84"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example83" class="collapse mx-3 small d-print-block"> + <div id="example84" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -6062,10 +6133,10 @@ is lexical: the label has to be "visible" from the break.</p> </h3> <p>The <code>?</code> operator, used as <code>EXP?</code>, is shorthand for <code>try EXP</code>.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example84" aria-expanded="false" aria-controls="example84"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example85" aria-expanded="false" aria-controls="example85"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example84" class="collapse mx-3 small d-print-block"> + <div id="example85" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -6156,10 +6227,10 @@ to form a regular expression must be escaped. For example, the regular expressio <p>Like <code>match</code>, but does not return match objects, only <code>true</code> or <code>false</code> for whether or not the regex matches the input.</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example85" aria-expanded="false" aria-controls="example85"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example86" aria-expanded="false" aria-controls="example86"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example85" class="collapse mx-3 small d-print-block"> + <div id="example86" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -6225,10 +6296,10 @@ the following fields:</p> </ul> <p>Capturing groups that did not match anything return an offset of -1</p> <div class="pb-3"> - <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example86" aria-expanded="false" aria-controls="example86"> + <button type="button" class="btn btn-sm btn-secondary text-body-secondary bg-transparent link-body-emphasis border-0" data-bs-toggle="collapse" data-bs-target="#example87" aria-expanded="false" aria-controls="example87"> <span class="me-1 d-print-none" aria-hidden="true"><span class="bi bi-chevron-right"></span><span class="bi bi-chevron-down"></span></span>Examples </button> - <div id="example86" class="collapse mx-3 small d-print-block"> + <div id="example87" class="collapse mx-3 small d-print-block"> <table class="table table-borderless table-sm w-auto"> <tr> <th class="pe-3">Command</th> @@ -6343,10 +6414,10 @@ the follow |