https://bugs.documentfoundation.org/show_bug.cgi?id=132870

--- Comment #5 from Jim Avera <[email protected]> ---
> Consider the String "5a". If I search using the regex "[0-9]*", I should get 
> 3 > matches: 
> - 0 to 1, which is 5
> - 1 to 1 and 2 to 2, which is empty

Could you clarify what you meant by "1 to 1" and "2 to 2"?  

The regex [0-9]* should always match anything (or nothing) because it means
"zero or more digits".  It will match as many digits as it can while still
allowing subsequent regex terms to match (in this example, there are no other
terms).

At each step during matching, the current regex term must succeed at the
current position of the input; if it does, then the next regex term is tried
etc. until all terms match.  If a regex term fails, then the engine has to
BACKTRACK and try a different choice in a previous regex term, if any (if there
is no previous term or all choices have been tried, then the overall match
fails).

In this case, since the regex can succeed matching zero characters, it will (or
should) match at any position of any input string, *even an empty input
string*.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to