• Login
Community
  • Login

Why can't I search up with regular expressions?

Scheduled Pinned Locked Moved General Discussion
2 Posts 2 Posters 4.8k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    Dan Lazich
    last edited by Feb 13, 2016, 11:01 PM

    Release 6.1 will allow me to search up when regular expression is selected. In all the newer releases I’ve tried once regular expression is check the up radio button is grayed out.

    Is there a way to get this feature back?

    1 Reply Last reply Reply Quote 0
    • G
      guy038
      last edited by guy038 Feb 15, 2016, 8:56 PM Feb 15, 2016, 8:55 PM

      Hello Dan,

      Indeed, you’re perfectly right about the Up radio button. it’s definitively greyed out :-(

      However, here is a work-around :

      • Make a first search of your regex, with the Find Next button

      • Close the Find dialog, with the ESC key

      • Simply, use the shortcut SHIFT + F3, by default, to perform a regular expression search, upwards

      • Or use the key F3, by default, to execute a search, downwards

      REMARK : Due to the structure of regular expressions, the different matches, of your regex, may be quite weird, while searching in an upwards direction !

      Just consider, below :

      SUBJECT string :  12345 This is a 123456789 simple text
      
      REGEX Search   :  \d
      

      If the cursor is at the end of the subject string, every use of the shortcut SHIFT + F3 matches the digit 9, then 8, 7, and so on… Quite logical isn’t it ?

      Now, let’s consider the same subject string and the other regex, below :

      SUBJECT string :  12345 This is a 123456789 simple text
      
      REGEX Search   :  \d+
      

      Again, place the cursor at the end of the subject string. After a first SHIFT+ F3, the string 122456789 is matched. Still correct !

      However, successive uses of the SHIFT +F3 shortcut, matches, successively, the string 12345678, then 1234567, 123456, till the unique digit 1. Now, using SHIFT + F3, again, it would match the string 12345, at the beginning of the subject string. Supplementary hits, on SHIFT + F3, would match the strings 1234, 123,… till the digit 1.

      The differences of behaviour, of the regex engine, are quite obvious !

      Best Regards,

      guy038

      1 Reply Last reply Reply Quote 0
      1 out of 2
      • First post
        1/2
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors