docs: explain how to include a double quote plus space in a nanorc regex

As double-quote-plus-space indicates the end of a regular expression
in a nanorc file, the inclusion of this combination *in* a regular
expression requires breaking the juxtaposition of the two, which
can be achieved by putting either of them between square brackets.

(It can also be achieved by preceding the space with a backslash,
which is shorter, but... the above method is more symmetrical.)

This addresses https://savannah.gnu.org/bugs/?62997.
This commit is contained in:
Benno Schulenberg 2022-09-01 12:27:24 +02:00
parent 9904aa5538
commit e7491920fd
2 changed files with 16 additions and 0 deletions

View File

@ -1201,6 +1201,14 @@ It also means that lookahead and lookbehind are not possible.
A complete explanation can be found in the manual of GNU grep:
@code{info grep regular}.
Each regular expression in a @file{nanorc} file should be wrapped in
double quotes (@code{""}). Multiple regular expressions can follow
each other on a line by separating them with blanks. This means that
a regular expression cannot contain a double quote followed by a blank.
When you need this combination inside a regular expression,
then either the double quote or the blank should be put
between square brackets (@code{[]}).
A separate syntax can be defined for each kind of file
via the following commands in a nanorc file:

View File

@ -426,6 +426,14 @@ It also means that lookahead and lookbehind are not possible.
A complete explanation can be found in the manual page of GNU grep:
\fBman grep\fR.
.sp
Each regular expression in a \fBnanorc\fR file should be wrapped in
double quotes (\fB""\fR). Multiple regular expressions can follow
each other on a line by separating them with blanks. This means that
a regular expression cannot contain a double quote followed by a blank.
When you need this combination inside a regular expression,
then either the double quote or the blank should be put
between square brackets (\fB[]\fR).
.sp
For each kind of file a separate syntax can be defined
via the following commands:
.TP