View Single Post
Old 02-17-2018, 02:27 PM   #32
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: 7,654
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi DiapDealer,
I agree completely. Returning a zero-length match makes no sense here for Sigil. Any search for words that returns non-words as matches is not useful. That is why that [a-zA-Z]* regular expression makes no sense as it would return everything even those with match length 0. The right regular expression to do what the user wants is [a-zA-Z]+ which works in Sigil just as expected.

KevinH


Quote:
Originally Posted by DiapDealer View Post
@KevinH:

Some regex search engines actually return 0 length matches and allow you to step through them using "find next".

In cases like that using your string:
Code:
<p> this is a line of text </p>
The first "match" would be a zero-length match ('<')
Hitting Find again would match 'p'.
Hitting Find again would be a zero-length match ('>')
Hitting Find again would be a zero-length match (the space)
Hitting Find one more time would match 'this'
etc...

Sigil's regex search feature has never "advanced" beyond the first zero-length match to my knowledge. And I don't see any compelling reasons to make it do so. Having to hit "Find" two, three (or more) times before you find a "real" match doesn't seem all that useful or intuitive to me.
KevinH is offline   Reply With Quote