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

Re: [NTS] RegExp and Whole Words

Expand Messages
  • Alan C.
    Hi Jody, Sheri, Alec, Everyone, ... Yes, to my knowledge, the Perl regex has whole word switch(s). But I forget what whole word in Notetab means. If it means
    Message 1 of 16 , Oct 13, 2002
    • 0 Attachment
      Hi Jody, Sheri, Alec, Everyone,

      >for things like regular expression engines and zip file searching
      >etc. A different regexp engine might support some of the perl
      >extensions, which I believe supports whole word type switches.

      Yes, to my knowledge, the Perl regex has whole word switch(s).

      But I forget what whole word in Notetab means. If it means do a find for te in Notetab and the te is found therein

      Then, in Perl, you'd just put te into the Perl match operater which is two forward slashes (//). So, thus:

      /te/

      finds te within notetab (no boundaries assigned)

      Next is introduced Perl's boundary switch \b

      /\bte/

      will match te also will match tetab (boundary on left)

      /te\b/

      will match te also will match note (boundary on right)

      /\bte\b/

      Will not find a match in notetab does a regex search for te it can be (like the below \w+) but does not have to be exactly like the \w+

      --

      Perl regex can match a word as in a string of words delimited by spaces. Thus:

      \w+

      I think the above is Perl's equivalent for Notetab's \w

      For in Perl, \w is any word character, not a word.

      /te\w+/

      Will not find a match in notetab (and that's because it is looking for te as a word in between other words, delimited by spaces just like these words in my sentence here).

      --
      Alan.
    • Sheri
      ... Hi Jody, You should ask Dave if he would consider adding an option for compound (i.e., and ) type testing. Then you wouldn t need to try to make
      Message 2 of 16 , Oct 14, 2002
      • 0 Attachment
        --- In ntb-scripts@y..., Jody <av1611@e...> wrote:
        > I'm learning. Thanks! I did write Dave Vest, the author of AR to
        > see if he knows a shorter method using AR.
        >

        Hi Jody,

        You should ask Dave if he would consider adding an option for
        compound (i.e., "and") type testing. Then you wouldn't need to try
        to make alternates (which are really "or" tests) act like "and"'s.

        > Download Agent Ransack from Simtel.net (agentr05.exe)
        > http://www.simtel.net/pub/dl/18453.shtml
        >

        Just curious, what version does your Help|About screen show in Agent
        Ransack? Is it 5?!! as implied by the exe above?

        Mine, installed a few months ago, shows 1.7.1 (Prebuild 303)

        Regards,
        Sheri
      • Sheri
        ... find for te in Notetab and the te is found therein ... Hi Alan, Its pretty moot since Whole Word is not an option in Notetab when Regexp is elected. But
        Message 3 of 16 , Oct 14, 2002
        • 0 Attachment
          --- In ntb-scripts@y..., "Alan C." <acumming@c...> wrote:

          > Yes, to my knowledge, the Perl regex has whole word switch(s).
          >
          > But I forget what whole word in Notetab means. If it means do a
          find for te in Notetab and the te is found therein
          >

          Hi Alan,

          Its pretty moot since "Whole Word" is not an option in Notetab when
          Regexp is elected. But in non-Regexp searches (in Notetab)
          when "Whole word" is checked "te" wouldn't find "Note". Perl and
          Notetab both have special patterns for matching in Regular
          Expressions (Perl's being more extensive than Notetab's), but to have
          a match "option" for "whole words" in Perl (such as Notetab has for
          non-Regexp), wouldn't it have to be like the g (global) and i (case
          insensitive) options? I don't think there is one.

          Regards,
          Sheri (Perl novice)
        • Jody
          Hi Sheri, No the link is for the last public release I believe. You have a slightly newer beta than me. Mine: 7.1 beta build 294. I ll send you his eMail
          Message 4 of 16 , Oct 14, 2002
          • 0 Attachment
            Hi Sheri,

            No the link is for the last public release I believe. You have a
            slightly newer beta than me. Mine: 7.1 beta build 294.

            I'll send you his eMail addie. ;) It might be on the web and I do
            not know if I have a "private" address or not.

            >You should ask Dave if he would consider adding an option for
            >compound (i.e., "and") type testing. Then you wouldn't need to
            >try to make alternates (which are really "or" tests) act like
            >"and"'s.
            >
            >> Download Agent Ransack from Simtel.net (agentr05.exe)
            >> <http://www.simtel.net/pub/dl/18453.shtml>http://www.simtel.net/pub/dl/18453.shtml
            >>
            > Just curious, what version does your Help|About screen show in
            > Agent Ransack? Is it 5?!! as implied by the exe above?
            >
            > Mine, installed a few months ago, shows 1.7.1 (Prebuild 303)

            Happy Script'n!
            Jody Adair

            UnSubscribe, Options
            mailto:ntb-Scripts-UnSubscribe@yahoogroups.com
            http://groups.yahoo.com/group/ntb-clipclass

            The NoteTabbers Assistant Page
            http://www.notetab.net
          • Alan C.
            Hi Sheri, ... Yes mine act same. Notetab done changed on me. Ntab did not used to have the C (complete whole word) option (in what millenium did Eric do
            Message 5 of 16 , Oct 14, 2002
            • 0 Attachment
              Hi Sheri,

              >But in non-Regexp searches (in Notetab)
              >when "Whole word" is checked "te" wouldn't find "Note".

              Yes mine act same.

              Notetab done changed on me. Ntab did not used to have the C (complete whole word) option (in what millenium did Eric do that?)

              ^!Find "te" ISC
              ^!IfError err
              ^!Goto exit
              :err
              ^!Prompt te not found
              ; C complete whole word
              ; T look through inside other words too


              no,te,tab

              when a delimiter exists as above then whole words finds te

              but remove the C and instead use the T and the notetab word the te is found (proper since can find within a larger word)

              >a match "option" for "whole words" in Perl (such as Notetab has for
              >non-Regexp)

              to look for te

              such regex match option in Perl is

              te\w+

              or a boundary switch on each side of te probably would do it as well

              \bte\b

              I didn't know any regex at all, not even Ntab's.

              Since I have some good books for learning Perl includes regex.

              Then for last year and a half or so I been learning Perl as well as Perl's regex.

              I figured I wouldn't need to learn Ntab's regex.

              Perl also can regex directly on disk file(s) also dir(s) then those results could be captured in Ntab.

              Alternatively, there's the runperl command which could use perl regex directly on a Ntab doc.

              I've heard there can be a slowness with Perl as compared to Ntab. But I don't understand that and wonder if it could be worked around just by using a different method as in one of those above two (runperl or disk file/capture) methods.

              --
              Alan.
            • Jody
              Hi Sheri, I will need to tell Dave about the space. Maybe he can add it to his new search thingie if not there. ... Happy Script n! Jody Adair UnSubscribe,
              Message 6 of 16 , Oct 16, 2002
              • 0 Attachment
                Hi Sheri,

                I will need to tell Dave about the space. Maybe he can add it to
                his new search thingie if not there.

                >I don't think it would pick up the two words with just one space
                >between them. Two delimiters, (eg, a comma and space, or a period
                >and a space) would work, but not just one space. Hopefully that
                >doesn't put a fly in the ointment <g>


                Happy Script'n!
                Jody Adair

                UnSubscribe, Options
                mailto:ntb-Scripts-UnSubscribe@yahoogroups.com
                http://groups.yahoo.com/group/ntb-clipclass

                The NoteTabbers Assistant Page
                http://www.notetab.net
              Your message has been successfully submitted and would be delivered to recipients shortly.