From d2f1ddbd5a55461195941a8e3134360916942104 Mon Sep 17 00:00:00 2001 From: pkoppstein Date: Thu, 15 Jun 2023 18:59:48 -0400 Subject: manual.yml - Perl NG (#2614) --- docs/content/manual/manual.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/content/manual/manual.yml b/docs/content/manual/manual.yml index f88929d5..0d552c7f 100644 --- a/docs/content/manual/manual.yml +++ b/docs/content/manual/manual.yml @@ -2304,9 +2304,12 @@ sections: jq uses the [Oniguruma regular expression library](https://github.com/kkos/oniguruma/blob/master/doc/RE), - as do PHP, Ruby, TextMate, Sublime Text, etc, so the + as do PHP, TextMate, Sublime Text, etc, so the description here will focus on jq specifics. + Oniguruma supports several flavors of regular expression, so it is important to know + that jq uses the ["Perl NG" (Perl with named groups)](https://github.com/kkos/oniguruma/blob/master/doc/SYNTAX.md) flavor. + The jq regex filters are defined so that they can be used using one of these patterns: @@ -2321,6 +2324,10 @@ sections: * REGEX, after string interpolation, should be a valid regular expression; * FILTER is one of `test`, `match`, or `capture`, as described below. + Since REGEX must evaluate to a JSON string, some characters that are needed + to form a regular expression must be escaped. For example, the regular expression + `\s` signifying a whitespace character would be written as `"\\s"`. + FLAGS is a string consisting of one of more of the supported flags: * `g` - Global search (find all matches, not just the first) -- cgit v1.2.3