IDEA: Add replacement RegEx to Find MRU list

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Bulgrien
    Carpal Tunnel
    • Oct 2007
    • 1772

    IDEA: Add replacement RegEx to Find MRU list

    While working with replacements... the user will occasionally key invalid regex in the replacements tab under session settings (at least this user, who is not a regex expert, is prone to an occasional mistake)

    May I suggest that regex expressions entered via the Replacements tab be added to the Find MRU list so that a user can perform a Find... from the Search dropdown menu to test the regular expression after-the-fact without having to remember or retype it? This could be implemented as a tweak if you don't think it should be implemented as default functionality... but I, for one, would definitely make use of it.
    BC v4.0.7 build 19761
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Erik
    Team Scooter
    • Oct 2007
    • 437

    #2
    The new release (3.0.5) has "Next/Previous Replacement" commands which should help you figure out if your replacements are working okay.
    Erik Scooter Software

    Comment

    • Michael Bulgrien
      Carpal Tunnel
      • Oct 2007
      • 1772

      #3
      Thanks Erik,

      But I don't think you understand the intent of my request.

      First of all, if I already have 3 replacements defined and add a fourth one, the "Next Replacement" feature (as helpful as it may be) will not neccessarily easily confirm whether or not my new replacement is working.

      More importantly, if my regular expression is faulty, the "Next Replacement" feature will not enable me to trouble-shoot my regular expression. It is still a trial and error cycle of going into replacements, tweaking the regular expression, closing my session settings and retrying...

      When I define a new replacement using a regular expression, I would like that regular expression added to the Search \ Find... MRU list so that I can quickly launch the Search \ Find... dialog to tweak and test the regular expression without having to go back into Session Settings. Once the regular expression successfully finds the desired text in the Search \ Find... dialog, I can copy the expression and relaunch the Session Settings dialog to paste the corrected regular expression into my replacement definition.
      BC v4.0.7 build 19761
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

      Comment

      • Erik
        Team Scooter
        • Oct 2007
        • 437

        #4
        I assumed when you were defining a regular expression for a replacement, you were looking to make specific important difference(s) go away. If that were the case you'd just have to navigate through the replacements until you got to or past that difference.

        Since this doesn't seem to satisfy you, I'll suggest that you open up 2 views of the same file(s) and do your search in one of them and your replacement in the other.

        FYI, if you type in an invalid regular expression, the "Replacement Item" dialog will show you an error message.
        Erik Scooter Software

        Comment

        • Michael Bulgrien
          Carpal Tunnel
          • Oct 2007
          • 1772

          #5
          Thanks for your suggestion...

          I guess you're saying that you won't consider my request. I'll just have to continue doing it the way I do today... I'll have to (1) re-open Session Settings, (2) Click on the replacements tab, (3) select and edit the replacement that is not working, (4) copy the regular expression, (5) close the Replacement Item dialog, (6) Close Session Settings, (7) Launch the Search \ Find dialog, (8) paste in the regular expression, check the regular expression check box, and start trouble-shooting.

          It sure would be a lot easier if I could just launch the Search dialog and select the RegEx from the MRU list... but I guess that would make things too easy for the user...
          BC v4.0.7 build 19761
          ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

          Comment

          • Erik
            Team Scooter
            • Oct 2007
            • 437

            #6
            I don't understand why you don't like my suggestion of using another window. It would save you the steps of closing and opening dialogs.

            The real issue you have is that you're struggling with regular expressions. There are lots of resource out there to help you with them. For example:
            http://www.perl.com/doc/manual/html/pod/perlre.html
            Erik Scooter Software

            Comment

            • Michael Bulgrien
              Carpal Tunnel
              • Oct 2007
              • 1772

              #7
              Originally posted by Erik
              I don't understand why you don't like my suggestion of using another window. It would save you the steps of closing and opening dialogs.
              No, it wouldn't... If I write a regular expression and get it wrong, following your steps I would have to (1) Save my session, (2) open a new instance of BC3, (3) select the saved session from the Sessions tree and launch it (4) go back to the original BC3 window and (5) re-open Session Settings, (6) Click on the replacements tab, (7) select and edit the replacement that is not working, (8) copy the regular expression, (9) leave the session settings dialog open and go back to the second BC3 window then (10) Launch the Search \ Find dialog, (11) paste in the regular expression, check the regular expression check box, and start trouble-shooting.

              It is actually takes more steps than what I am doing today.

              Originally posted by Erik
              The real issue you have is that you're struggling with regular expressions.
              While I am not a regular expression expert, I am just competent enough to have some level of confidence in what I write...else I would probably always start from the find dialog first then go to the Replacements tab afterwards. I do not need any RegEx resources...I already have all the resources I need...and I've assisted several other forum members on regular expression questions in the past. The problem is that sometimes I work with quite lengthly and complex regular expressions. what I need is a quick way to work with an expression when it's complexity prevents me from getting it right the first time.
              Last edited by Michael Bulgrien; 18-Sep-2008, 10:17 AM.
              BC v4.0.7 build 19761
              ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

              Comment

              • Erik
                Team Scooter
                • Oct 2007
                • 437

                #8
                Once you've established that a particular regular expression replacement is not working:
                • Select Session -> Compare In New View Using -> Text Compare.
                • In your original view, open your "Session Settings" dialog to the "Replacements" page and copy the problem expression to the clipboard.
                • In the new view, Select Find... and paste the expression and test it.
                • You can switch between the views to test multiple expressions.


                Of course you're welcome to use whatever steps you like, but I think this is much faster.
                Erik Scooter Software

                Comment

                • Michael Bulgrien
                  Carpal Tunnel
                  • Oct 2007
                  • 1772

                  #9
                  A new view opens in a new tab on my system. That's the way I prefer it. Since the Session Settings dialog is modal, I cannot work with a find dialog in one tab while a session settings dialog is open over another.
                  BC v4.0.7 build 19761
                  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

                  Comment

                  • Erik
                    Team Scooter
                    • Oct 2007
                    • 437

                    #10
                    Okay, you can make a tab into a new window by right clicking on its header and selecting Tear Off.
                    Erik Scooter Software

                    Comment

                    • Michael Bulgrien
                      Carpal Tunnel
                      • Oct 2007
                      • 1772

                      #11
                      Thank you. That is, indeed, a useful feature to know.
                      BC v4.0.7 build 19761
                      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

                      Comment

                      Working...