Loading ...
Sorry, an error occurred while loading the content.
 

Re: ^!Find Command - Reverse Regular Expression Search

Expand Messages
  • Sheri
    ... Regex searching is strictly forward. The B and T options are not applicable to regex. You can manipulate the cursor position with clip commands before
    Message 1 of 7 , Aug 5, 2008
      --- In ntb-clips@yahoogroups.com, "Dan Gagne" <dgagne@...> wrote:
      >
      > I would like to perform a backward ^!Find using a regular
      > expression, but the search engine ignores the backward flag when
      > the regular expression flag is included. example
      >
      > ^!Find ".sqf" BS
      >
      > works fine but doesn't include a regular expression.
      >
      > ^!Find "^.{1,30}\.sqf" RBS
      >
      > fails to go backward and indeed finds a match in the forward
      > direction. Does the regular expression switch disable the reverse
      > switch for the ^!Find command?
      >
      > any help is appreciated.
      >

      Regex searching is strictly forward. The B and T options are not
      applicable to regex. You can manipulate the cursor position with clip
      commands before doing your ^!Find if that helps.

      Regards,
      Sheri
    • ebbtidalflats
      Hi Sheri, Eric, While I m no expert in regular expressions, I do manage to use them successfully (partly with Sheri s help) for some time. It had never
      Message 2 of 7 , Aug 5, 2008
        Hi Sheri, Eric,

        While I'm no expert in regular expressions, I do manage to use them
        successfully (partly with Sheri's help) for some time.

        It had never occurred to me, that REGEXP doesn't search backwards.
        In any case, the help for ^!Find does not make it clear, which option
        switches apply to RegExp searching, and which don't.

        If the help has been changed in this regard since NTP 5.70 disregard
        my post.



        Regards,


        Eb


        --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
        >
        > Regex searching is strictly forward. The B and T options are not
        > applicable to regex.
      • Sheri
        ... Also not applicable to C option. While the option help should be improved, I did find in Main Help this concerning the direction of searching and regular
        Message 3 of 7 , Aug 5, 2008
          --- In ntb-clips@yahoogroups.com, "ebbtidalflats" <ebbtidalflats@...>
          wrote:
          >
          > Hi Sheri, Eric,
          >
          > While I'm no expert in regular expressions, I do manage to use them
          > successfully (partly with Sheri's help) for some time.
          >
          > It had never occurred to me, that REGEXP doesn't search backwards.
          > In any case, the help for ^!Find does not make it clear, which option
          > switches apply to RegExp searching, and which don't.
          >
          > If the help has been changed in this regard since NTP 5.70 disregard
          > my post.
          >
          >
          >
          > Regards,
          >
          >
          > Eb
          >
          >
          > --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@> wrote:
          > >
          > > Regex searching is strictly forward. The B and T options are not
          > > applicable to regex.
          >

          Also not applicable to C option.

          While the option help should be improved, I did find in Main Help this
          concerning the direction of searching and regular expressions:

          "The Find expression finds a string of text that starts at the
          leftmost position in the input line that matches, and continues to the
          rightmost position that matches."

          Regards,
          Sheri
        • John Shotsky
          Dan, If you have an example of text that you d be searching, and the look behind item you d be searching for, there are possibly ways to do what you want
          Message 4 of 7 , Aug 5, 2008
            Dan,

            If you have an example of text that you'd be searching, and the look behind item you'd be searching for, there are
            possibly ways to do what you want without an explicit backwards search. I often need to find something between two
            distinct points - the beginning and end of a given line. It depends on what you are looking to accomplish whether
            certain techniques will work.

            If I see an exact example of what you want to do, I may be able to help.

            John

            From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Dan Gagne
            Sent: Tuesday, August 05, 2008 8:46 AM
            To: ntb-clips@yahoogroups.com
            Subject: [Clip] ^!Find Command - Reverse Regular Expression Search

            I would like to perform a backward ^!Find using a regular expression,
            but the search engine ignores the backward flag when the regular
            expression flag is included. example

            ^!Find ".sqf" BS

            works fine but doesn't include a regular expression.

            ^!Find "^.{1,30}\.sqf" RBS

            fails to go backward and indeed finds a match in the forward
            direction. Does the regular expression switch disable the reverse
            switch for the ^!Find command?

            any help is appreciated.

            Dan Gagne



            [Non-text portions of this message have been removed]
          • ebbtidalflats
            ... Thanks for looking that up. I m sure you would agree, that a person confused about RegExp in general is highly unlikely to find that particular help,
            Message 5 of 7 , Aug 6, 2008
              --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
              >
              >
              > "The Find expression finds a string of text that starts at the
              > leftmost position in the input line that matches, and continues to the
              > rightmost position that matches."
              >

              Thanks for looking that up.


              I'm sure you would agree, that a person confused about RegExp in
              general is highly unlikely to find that particular help, except by
              accident. Besides, you had inside information, didn't you ;=]

              Not that I'm complaining, but the description of regular expressions
              is so overwhelming, that it discourages a first use.



              Cheers,


              Eb
            • Axel Berger
              ... I fully agree. It took me a long time to find my way around in there. But on the other hand I couldn t suggest a way to make it better, so at least inside
              Message 6 of 7 , Aug 7, 2008
                ebbtidalflats wrote:
                > but the description of regular expressions
                > is so overwhelming, that it discourages a first use.

                I fully agree. It took me a long time to find my way around in
                there. But on the other hand I couldn't suggest a way to make it
                better, so at least inside my capabilities the help we have is the
                best one possible.
                It's a very good thing this group here exists -- with all the help I
                have received I can by now give the odd hint myself every now and
                then.

                Axel
              Your message has been successfully submitted and would be delivered to recipients shortly.