nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit e7491920fd06bdb5eb42303cd84dbb9caca42cb7
parent 9904aa5538dabf885f3cdb6d1e0e88714aef0138
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu,  1 Sep 2022 12:27:24 +0200

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.

Diffstat:
Mdoc/nano.texi | 8++++++++
Mdoc/nanorc.5 | 8++++++++
2 files changed, 16 insertions(+), 0 deletions(-)

diff --git 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 @@ -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