1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-12 14:30:42 -08:00
emacs/doc
Mattias Engdegård be91192ecb Straighten regexp postfix operator after zero-width assertion parse
The zero-width assertions \` \' \b \B were parsed in a sloppy way so
that a following postfix repetition operator could yield surprising
results.  For instance, "\\b*" would act as "\\b\\*", and "xy\\b*"
would act as "\\(?:xy\\b\\)*".

Except for \` and ^, any following postfix operator now applies to the
zero-width assertion itself only, which is predictable and consistent
with other assertions, if useless in practice.
For historical compatibility, an operator character following \` and ^
always becomes a literal. (Bug#64128)

* src/regex-emacs.c (regex_compile):
Set `laststart` appropriately for each zero-width assertion instead
of leaving it with whatever value it had before.
Remove a redundant condition.
* test/src/regex-emacs-tests.el
(regexp-tests-zero-width-assertion-repetition): New test.
* doc/lispref/searching.texi (Regexp Special):
Say that repetition operators are not special after \`,
and that they work as expected after other backslash escapes.
* etc/NEWS: Announce.
2023-06-21 18:00:26 +02:00
..
emacs Call them “bracket expressions” more consistently 2023-06-19 11:09:00 -07:00
lispintro Fix some Texinfo markup in manuals 2023-06-13 15:29:06 +01:00
lispref Straighten regexp postfix operator after zero-width assertion parse 2023-06-21 18:00:26 +02:00
man ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
misc Correct handling of template markers on deletion/insertion 2023-06-21 15:43:41 +00:00