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

[NTS] Re: Dot matching newlines??

Expand Messages
  • Sheri
    ... lol! NoteTab has had named captures since NoteTab version 5.0. PCRE has had them since PCRE version 6.7 (current version is 7.4) At first the PCRE
    Message 1 of 14 , Nov 1, 2007
    • 0 Attachment
      --- In ntb-scripts@yahoogroups.com, "Alan C" <acummingsus@...> wrote:
      >
      >
      > At there, can see in Perl 5.9.5 (devel, not stable) has named
      > captures, coming in Perl 5.10
      >
      > Does Notetab have named captures?
      >
      > I see it also has at there url the 1st page of the named captures
      > article (I'm unaware how much is disclosed in the 1st page) (the
      > name tag [ for person to wear ] has (I guess) a named capture on
      > it) -- as usual, I need to study more (always behind in my
      > studies)
      > --

      lol! NoteTab has had named captures since NoteTab version 5.0. PCRE
      has had them since PCRE version 6.7 (current version is 7.4)

      At first the PCRE conventions for named captures was modeled after
      Python, but then .Net's naming version was added, and now that Perl
      has adopted one, PCRE supports that convention also.

      So for regex patterns in NoteTab, named captures can be specified with
      (?<name>...) or (?'name'...) or (?P<name>...)

      Simple backreferences within the pattern can be specified as \k{name}
      or \k<name> or \k'name' or (?P=name) or \g{name}. You can also use
      names for conditional patterns and subroutines (and they have several
      supported conventions too).

      Backreferences in NoteTab's replacement string are written $<name>

      So, when it comes to named captures, NoteTab and PCRE are ahead of
      Perl's curve so to speak.

      Another of the newer features I use alot is \K. \K resets the (whole)
      match start postion. So "Happy \KBirthday" matched against "Happy
      Birthday" returns "Birthday" as the whole match. Unlike a lookbehind
      assertion, what precedes \K is not required to be a fixed length. Perl
      will have \K in version 5.10.

      Regards,
      Sheri
    • Rob Springer
      Maybe I m going crazy... Is there some sort of persistence to the setting of these modes? Specifically with using the std search/replace box. I m occasionaly
      Message 2 of 14 , Nov 9, 2007
      • 0 Attachment
        Maybe I'm going crazy...

        Is there some sort of persistence to the setting of these modes?
        Specifically with using the std search/replace box.
        I'm occasionaly getting some weird behavior that could be due to being
        in the wrong mode, but I can't pin it down.

        It does seem that you can use the "unset" techniques on these options
        to be sure it is in the correct mode.

        Thanks,
        Rob

        --- In ntb-scripts@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
        >
        > --- In ntb-scripts@yahoogroups.com, "Rob Springer" <springro@> wrote:
        > >
        > > Hi,
        > >
        > > PCRE lists it has a "dotall" mode that allows for the . character to
        > > also match any sort of line feed / CRs also.
        > >
        > > Is there a way to turn on this option in NTB5.5??
        > >
        > > Thanks,
        > > Rob
        >
        > Sure, by including (?s) at the start of the pattern. See the "Internal
        > Option Setting" part of the regex help file.
        >
        > Regards,
        > Sheri
        >
      • Sheri
        ... No. However I do think that NoteTab defaults to multiline and (at least for ^$GetDocMatchAll$) to case insensitive.
        Message 3 of 14 , Nov 9, 2007
        • 0 Attachment
          --- In ntb-scripts@yahoogroups.com, "Rob Springer" <springro@...> wrote:
          >
          > Maybe I'm going crazy...
          >
          > Is there some sort of persistence to the setting of these modes?
          > Specifically with using the std search/replace box. I'm
          > occasionaly getting some weird behavior that could be due to
          > being in the wrong mode, but I can't pin it down.

          No. However I do think that NoteTab defaults to multiline and (at
          least for ^$GetDocMatchAll$) to case insensitive.

          http://tech.groups.yahoo.com/group/ntb-clips/message/16627

          > It does seem that you can use the "unset" techniques on these
          > options to be sure it is in the correct mode.

          True.

          Regards,
          Sheri
        • Alan C
          ... Does it matter whether or not the word wrap is turned or switched off when using a regex in the search dialog (obviously on the current document(s) ). --
          Message 4 of 14 , Nov 9, 2007
          • 0 Attachment
            On Nov 9, 2007 8:44 AM, Sheri <silvermoonwoman@...> wrote:
            > --- In ntb-scripts@yahoogroups.com, "Rob Springer" <springro@...> wrote:
            > >
            > > Maybe I'm going crazy...
            > >
            > > Is there some sort of persistence to the setting of these modes?
            > > Specifically with using the std search/replace box. I'm
            > > occasionaly getting some weird behavior that could be due to
            > > being in the wrong mode, but I can't pin it down.
            >
            > No. However I do think that NoteTab defaults to multiline and (at
            > least for ^$GetDocMatchAll$) to case insensitive.
            >
            > http://tech.groups.yahoo.com/group/ntb-clips/message/16627
            >
            > > It does seem that you can use the "unset" techniques on these
            > > options to be sure it is in the correct mode.
            >
            > True.

            Does it matter whether or not the word wrap is turned or switched off
            when using a regex in the search dialog (obviously on the current
            document(s) ).

            --
            Alan.
          • Sheri
            ... Hi Alan, I don t think word wrap mode has any effect on search results via the dialogs or clip commands (regex or not regex). However, it does matter for
            Message 5 of 14 , Nov 9, 2007
            • 0 Attachment
              --- In ntb-scripts@yahoogroups.com, "Alan C" <acummingsus@...> wrote:
              >
              > Does it matter whether or not the word wrap is turned or switched off
              > when using a regex in the search dialog (obviously on the current
              > document(s) ).

              Hi Alan, I don't think word wrap mode has any effect on search results
              via the dialogs or clip commands (regex or not regex). However, it
              does matter for other clip commands like ^!Jump.

              Regards,
              Sheri
            Your message has been successfully submitted and would be delivered to recipients shortly.