Quote:
Originally Posted by eschwartz
Never seen \K before.
Seems like it is useful mainly as a replacement for lookbehind assertions (while still capturing stuff! )
|
Actually, I could be wrong. \K may not be a part of the regex module being used in calibre. I will miss it very much if so.
But then again... with variable-length lookbehind assertions allowed, it may not be all that hard to replicate \K's functionality!
I've just always hated remembering the lookbehind syntax:
When using the string 'hhhhhhhhhhhhhhhhhhhhhhd':
It was always easier to search for h+\Kd in Sigil (provided finding a 'd' that follows a potentially unknown number of 'h's was as vitally important to you as it is to me!
). Beside the fact that (?<=h+)d wouldn't fly in Sigil, the (?<=) and (?<!) hokum of lookbehinds was (and still is) always difficult for me to remember on the fly. I find it terribly unintuitive.
But now that (?<=h+)d WILL work in calibre's editor ... the \K isn't AS vitally important to me--provided I get over the mental stumbling block of remembering the (positive|negative) look(ahead|behind)'s syntax.
So with the exception of the case alteration on replacements, what are you finding you can't do in calibre's regex S&R that you could in Sigil's?