View Single Post
Old 04-09-2018, 09:15 AM   #5
DrChiper
Bookish
DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.
 
DrChiper's Avatar
 
Posts: 1,035
Karma: 2006208
Join Date: Jun 2011
Device: PC, t1, t2, t3, Clara BW, Clara HD, Libra 2, Libra Color, Nxtpaper 11
Correct. It was my intention to place an anchor for adding some substring.

But: it appears that this is a so-called "zero length match" situation, which seem to be some gray area in regex engines. There is no consensus about the behavior, other than that infinite (lookup) loops must be avoided.

To force, for instance, an zero length match, use the expression [\.]{0}
This will match after every character in a string.
calibre's regex engine halts and reports no matches.
The Notepad++ regex engine, for instance, flags every character correctly as a "zero length match", but happily uses the anchor to substitute, starting that anchor location, any substring.
Two regex engines, different behavior.

So in the end, I have to "program" around this for calibre, which is doable.
Thanks for your time.
DrChiper is offline   Reply With Quote