Tapatalk

UltraEdit and Unix regular expression search skips a character on running the find upwards

UltraEdit and Unix regular expression search skips a character on running the find upwards

8
NewbieNewbie
8

    Jul 02, 2023#1

    If the cursor is at the end of this line:

    Code: Select all

    0123456789
    ... and I search for UltraEdit regular expression [0-9] (any digit), and click Previous, it should find the digit 9. Instead it skips the digit 9 and finds the digit 8.

    UltraEdit for Windows v14.00 does not do that, but UltraEdit 2023.0.0.50 does. Am I doing something wrong, or is this a bug?

    6,686587
    Grand MasterGrand Master
    6,686587

      Jul 02, 2023#2

      It is indeed a bug. I could reproduce the issue, analyzed it further with various versions of UltraEdit and sent an issue report by email to UltraEdit support as it can be seen below.

      It looks like a regular expression find upwards using one of the two legacy regular expression engines is done rarely by UltraEdit/UEStudio users because of this bug exists undiscovered already for more than thirteen years.

      There is an UltraEdit and Unix regular expression find issue on running the find upwards from UltraEdit for Windows v16.00.0.1025 up to currently latest v2023.0.0.50.

      The steps to reproduce are as follows:
      1. Create a new file with the line:

        Code: Select all

        Sample line 01
        It does not matter if this line has also a line termination with carriage return and line-feed or not. It is important that the caret is positioned at end of this line.
      2. Press Alt+F3 to open the Find window and enter [0-9] as expression.
      3. Check the option Regular expressions and select either UltraEdit or Unix as regular expression engine to use for finding a single digit.
      4. Click on button Previous to run the UltraEdit/Unix regular expression find upwards from current caret position at the end of the line.
      There should be found and selected first the character 1 at the end of the line. But there is found and selected the character 0 before the last digit left to the caret on running the regular expression find.

      This legacy regular expression find upwards issue does not exist with UltraEdit for Windows v15.20.0.1027 and former versions which all find the character 1 at end of the line on running same UltraEdit/Unix regular expression find from the end of the line in upwards direction.

      This issue is also not reproducible with any version of UltraEdit on using the Perl regular expression engine. The wrong search behavior exists only with the UltraEdit or Unix regular expression engine.

      The same issue exists also on appending one more digit like 2 to the line.

      Code: Select all

      Sample line 012
      Positioning the caret left to digit 2 with text cursor blinking between the digits 1 and 2 and running the same UltraEdit/Unix regular expression find for a single digit upwards with a click on button Previous results in finding the digit 0 instead of the digit 1.
      Best regards from an UC/UE/UES for Windows user from Austria

      8
      NewbieNewbie
      8

        Jul 05, 2023#3

        Thank you very much Mofi. That raises another question which I will pose in a new thread.