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

            Bug ID: 152690
           Summary: Operator Like handles "!" in character set wrong, when
                    "!" is not the first in the set
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: difficultyBeginner, easyHack, skillCpp
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: mikekagan...@hotmail.com

LibreOffice supports Like operator [1], when using Option Compatible or Option
VBASupport.

Consider this code:

Sub TestLike()
  MsgBox "!" Like "[.!?]"
  MsgBox "^" Like "[.!?]"
End Sub

In MS VBA, it produces "True" first, and then "False".
In LibreOffice, it produces "False" first, and then "True".

This is because character "!" should mean negation, only when it's the first
character in the group; in other positions, it matches itself.

Code pointer: function VBALikeToRegexp in basic/source/runtime/runtime.cxx,
which should only check for "!" immediately after "[", and not in other
positions.

[1]
https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/like-operator

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to