From e7491920fd06bdb5eb42303cd84dbb9caca42cb7 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 1 Sep 2022 12:27:24 +0200 Subject: [PATCH] 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. --- doc/nano.texi | 8 ++++++++ doc/nanorc.5 | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/doc/nano.texi b/doc/nano.texi index 7490e357..9b4a13d1 100644 --- a/doc/nano.texi +++ b/doc/nano.texi @@ -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: diff --git a/doc/nanorc.5 b/doc/nanorc.5 index c8166c02..a707ffd7 100644 --- a/doc/nanorc.5 +++ b/doc/nanorc.5 @@ -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