On 2023-06-17 13:07, Mattias EngdegÄrd wrote: > 17 juni 2023 kl. 20.44 skrev Stefan Monnier : > >> I think the behavior that makes most sense is to signal an error when >> compiling the regexp. > > Clearly, but some behaviour needs to be preserved for compatibility. > Regexps like "^*" aren't uncommon. Can it be generalised in a useful way? > doc/lispref/searching.texi says that "*" is treated as an ordinary character if it is in a context where its special meaning makes no sense, giving "*foo" as an example. If we break with this tradition by making "\b*" an error instead of being equivalent to "\b\*", we should update that part of the manual. One possible way forward is to update doc/lispref/searching.texi to specify what we want. Then we can modify the code to match the updated documentation. In my experience, modifying the doc is often the hard part, so I took a crack at that in the draft proposed patch, which I have not installed. Comments?