View Single Post
Old 06-24-2025, 05:32 PM   #12
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,879
Karma: 6120478
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by DNSB View Post
I think the behaviour of Sigil's regex in returning the first line of each file is correct if the global flag is not set. If I recall correctly—which may be iffy given the number of RegEx flavours I've played with—if global is not set, the search will return the first instance, if it is set, it will return all instances. So in this case, returning the first line of each file would be correct if global is not set.
The global flags was needed for early regex use yo make it find and replace all occurrences. But for PCRE2 the engine is different and as long as you keep calling match with updated offsets, the search and replace will continue.
KevinH is offline   Reply With Quote