[Libreoffice-bugs] [Bug 135538] Search-Replace: Regular Expression engine fails on zero length matches
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Mon Aug 31 23:09:56 UTC 2020
https://bugs.documentfoundation.org/show_bug.cgi?id=135538
--- Comment #9 from masz0 at yahoo.co.uk ---
(In reply to Michael Warner from comment #8)
> (In reply to masz0 from comment #7)
> > (In reply to Michael Warner from comment #5)
> > > (In reply to Heiko Tietze from comment #4)
> > > > IIUC, the original request was to find digits like ABC1EFG per "\d *". Works
> > >
> > > If I am not mistaken, "\d *" has a minimum length of one (a single digit),
> > > so is not an example of this bug. Trying to match "\d*" instead would have
> > > zero length.
> >
> > No, "\d *" tries to match for 1 digit, followed by 0+ spaces.
>
> Which is what I was trying to say. At any rate, I don't think it is a valid
> test case for the bug you reported, please correct me if I am wrong.
Oh, sorry, I misunderstood.
Affirmative for "\d *" being an invalid test.
Since it requires and matches one digit, not having any in the input (ABC-EFG)
will make it fail (legitimately; not thru the artificial limitation).
If the input does have digits (ABC1EFG), the pattern will match each in turn.
The matches will be length 1 (or more where followed one or more spaces) -
therefore LO won't discard them.
My problem was specifically about zero-width assertions "(?<=..)", "(?<!..)",
"(?=..)", "(?!..)", "^", and combinations of them. Unlike them, standalone "X*"
isn't very useful even though it too can be zero-length.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200831/f3a83ec1/attachment.htm>
More information about the Libreoffice-bugs
mailing list