From: dalanicolai <dalanicolai@gmail.com>
To: "Basil L. Contovounesios" <contovob@tcd.ie>
Cc: 47534@debbugs.gnu.org
Subject: bug#47534: Subject: 28.0.50; Regexp lower case pattern matches upper case
Date: Thu, 1 Apr 2021 12:27:58 +0200 [thread overview]
Message-ID: <CACJP=3=oX7jhKBGUcvjapTDeHph2VJWXzsa5Lv8uwqb7odyOLg@mail.gmail.com> (raw)
In-Reply-To: <CACJP=3mqi=+yWrfFGawLJgRTMi11XpugM6M1R4TSxOuvaLk0uw@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2494 bytes --]
And here is a small patch for the docs
On Thu, 1 Apr 2021 at 12:27, dalanicolai <dalanicolai@gmail.com> wrote:
> Here is a small patch for the re-builder docstring. I hope I did things
> correctly...
>
> On Thu, 1 Apr 2021 at 10:12, dalanicolai <dalanicolai@gmail.com> wrote:
>
>> Ah thanks. I thought I used case sensitive replace-regexp before, but
>> probably I am mistaking then. Section "34.3 Regular Expressions" of the
>> Emacs manual states that "[a-z]" or "[:lower:]" should match only lower
>> case, while it is not mentioned at all that it will not work by default
>> (case-fold-search as well as reb-toggle-case and reb-change-syntax are not
>> mentioned at all in that section as far as I can find). Indeed I was
>> referring to the docstring of re-builder. Anyway, I am happy to provide a
>> patch.
>>
>>
>>
>> On Thu, 1 Apr 2021 at 00:25, Basil L. Contovounesios <contovob@tcd.ie>
>> wrote:
>>
>>> dalanicolai <dalanicolai@gmail.com> writes:
>>>
>>> > When using the regexp builder and trying to match only lower case
>>> > letters (and spaces), Emacs also includes upper case matches.
>>>
>>> I think this is the effect of the user option case-fold-search, which
>>> defaults to non-nil (this is the case across most search-related parts
>>> of Emacs, including Isearch). You can toggle it in re-builder
>>> specifically with C-c C-c (reb-toggle-case), or across all buffers by
>>> customising case-fold-search to be nil.
>>>
>>> > Also, I am unable to find in the manual any information about the
>>> > option of setting different syntaxes in the regexp builder
>>>
>>> I think most of the documentation for re-builder.el is in its commentary
>>> at the start of the file; see M-x find-library RET re-builder RET.
>>>
>>> I haven't used re-builder much, but from M-x customize-group RET
>>> re-builder RET I see there is a user option reb-re-syntax for
>>> controlling the default syntax. C-h m in the re-builder buffer further
>>> reveals that the command C-c C-i (reb-change-syntax) can modify
>>> reb-re-syntax on the fly.
>>>
>>> > (also the option is not mentioned in the regexp-builder docstring). So
>>> > I would additionally like to report this as a documentation bug.
>>>
>>> Are you referring to the docstring of the re-builder command, or
>>> something else? And is it a listing of key bindings you would like to
>>> see, or something else? Would you like to provide a patch with
>>> suggestions for improvements?
>>>
>>> Thanks,
>>>
>>> --
>>> Basil
>>>
>>
[-- Attachment #1.2: Type: text/html, Size: 3529 bytes --]
[-- Attachment #2: improve-regexp-doc-add-note-case-sensitive --]
[-- Type: application/octet-stream, Size: 1211 bytes --]
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 16a8e56e90..05b81f0cd1 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -239,7 +239,7 @@ This variable is used by passing it as an argument to the function
A @dfn{regular expression}, or @dfn{regexp} for short, is a pattern that
denotes a (possibly infinite) set of strings. Searching for matches for
a regexp is a very powerful operation. This section explains how to write
-regexps; the following section says how to search for them.
+regexps; the following section says how to search for them. By default Emacs
@findex re-builder
@cindex regular expressions, developing
@@ -251,6 +251,10 @@ matches in the target buffer are highlighted. Each parenthesized
sub-expression of the regexp is shown in a distinct face, which makes
it easier to verify even very complex regexps.
+Note that by default Emacs search ignores case (@xref{Searching and Case}).
+To enable case-sensitive regexp search and match, set @code{case-fold-search}
+to @code{nil}.
+
@menu
* Syntax of Regexps:: Rules for writing regular expressions.
* Regexp Example:: Illustrates regular expression syntax.
next prev parent reply other threads:[~2021-04-01 10:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-31 21:58 bug#47534: Subject: 28.0.50; Regexp lower case pattern matches upper case dalanicolai
2021-03-31 22:25 ` Basil L. Contovounesios
2021-04-01 8:12 ` dalanicolai
2021-04-01 10:27 ` dalanicolai
2021-04-01 10:27 ` dalanicolai [this message]
2021-04-01 10:30 ` dalanicolai
2021-05-08 11:59 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACJP=3=oX7jhKBGUcvjapTDeHph2VJWXzsa5Lv8uwqb7odyOLg@mail.gmail.com' \
--to=dalanicolai@gmail.com \
--cc=47534@debbugs.gnu.org \
--cc=contovob@tcd.ie \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.