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

Re: Dot matching newlines??

Expand Messages
  • Sheri
    ... Sure, by including (?s) at the start of the pattern. See the Internal Option Setting part of the regex help file. Regards, Sheri
    Message 1 of 14 , Oct 31, 2007
    • 0 Attachment
      --- 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
    • Rob Springer
      Thanks! I m used to / commands you add at the end of it.
      Message 2 of 14 , Nov 1, 2007
      • 0 Attachment
        Thanks!

        I'm used to / commands you add at the end of it.

        --- 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
        >
      • Alan C
        ... Me too. For example, in Perl, to enable matching across multiple lines, an option is used/added at the end of the regex (whether it be a match or a
        Message 3 of 14 , Nov 1, 2007
        • 0 Attachment
          On Nov 1, 2007 9:11 AM, Rob Springer <springro@...> wrote:
          > --- In ntb-scripts@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
          > >
          > > --- In ntb-scripts@yahoogroups.com, "Rob Springer" <springro@> wrote:
          > > >
          > > > 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??
          > >
          > > Sure, by including (?s) at the start of the pattern. See the "Internal
          > > Option Setting" part of the regex help file.
          > >
          > Thanks!
          >
          > I'm used to / commands you add at the end of it.

          Me too. For example, in Perl, to enable matching across multiple
          lines, an option is used/added at the end of the regex (whether it be
          a match or a substitution).

          Which makes me wonder if this is a "difference" (not 100% "Perl"
          compatible) or if there is another explanation ie Notetab uses
          internal (tokens or something or other) for substitution -- pcre only
          applies to the match side of an expression in Notetab. Or, do I have
          some of this backwards?

          --
          Alan.
        • Sheri
          ... Perl supports internal and external options. PCRE also supports internal and external options, but leaves the interface up to the calling program. PHP,
          Message 4 of 14 , Nov 1, 2007
          • 0 Attachment
            --- In ntb-scripts@yahoogroups.com, "Alan C" <acummingsus@...> wrote:
            >
            > Me too. For example, in Perl, to enable matching across multiple
            > lines, an option is used/added at the end of the regex (whether
            > it be a match or a substitution).
            >
            > Which makes me wonder if this is a "difference" (not 100% "Perl"
            > compatible) or if there is another explanation ie Notetab uses
            > internal (tokens or something or other) for substitution -- pcre
            > only applies to the match side of an expression in Notetab. Or,
            > do I have some of this backwards?
            >

            Perl supports internal and external options. PCRE also supports
            internal and external options, but leaves the interface up to the
            calling program. PHP, which also uses PCRE, uses pattern delimiters
            similar to Perl. The only external option NoteTab exposes to the user
            is exact vs caseless matching. And that is done by way of checkbox in
            the dialog or as an option letter for the clip commands (not as a
            letter outside a pattern delimiter). NoteTab is likely using some PCRE
            external options itself (like setting multiline by default). The user
            has access to only to internal option settings (except caselessness
            where you can use either one).

            > pcre only applies to the match side of an expression in Notetab.
            > Or, do I have some of this backwards?

            no, that's correct.

            Regards,
            Sheri
          • Alan C
            ... [ very accustomed to options at end of regex ] ... Oh, so Perl can do it either way, either 1. (internal) by including (?s) at the start of the pattern or
            Message 5 of 14 , Nov 1, 2007
            • 0 Attachment
              On Nov 1, 2007 11:47 AM, Sheri <silvermoonwoman@...> wrote:
              > --- In ntb-scripts@yahoogroups.com, "Alan C" <acummingsus@...> wrote:
              [ very accustomed to options at end of regex ]
              >
              > Perl supports internal and external options. PCRE also supports
              > internal and external options, but leaves the interface up to the
              > calling program. PHP, which also uses PCRE, uses pattern delimiters
              > similar to Perl. The only external option NoteTab exposes to the user
              > is exact vs caseless matching. And that is done by way of checkbox in
              > the dialog or as an option letter for the clip commands (not as a
              > letter outside a pattern delimiter). NoteTab is likely using some PCRE
              > external options itself (like setting multiline by default). The user
              > has access to only to internal option settings (except caselessness
              > where you can use either one).
              >
              > > pcre only applies to the match side of an expression in Notetab.
              > > Or, do I have some of this backwards?
              >
              > no, that's correct.

              Oh, so Perl can do it either way, either 1. (internal) by including
              (?s) at the start of the pattern or 2. (external ie letter outside of
              a pattern delimiter) option(s) at the end of the regex.

              Guess I'd either forgotten or else had just grown so accustomed to
              using option(s) at the end of the regex (in Perl).

              My fault for using Perl too much, I suppose. (I'd already been using
              Perl and rather than grasp how to make Notetab do or behave like I'd
              been doing with Perl, I just kept using Perl).

              O.T. from next to end (subject is running Win apps integrated into the
              Linux desktop)

              But, then again, I'm using Linux too much nowadays these days as well
              . . . Kinda grows (bit by bit over time) on a person. Don't get
              hooked. Or, do get hooked if that's what you want. Virtual machine
              are handy nowadays, just need a bit of ram; then run two or three
              different O.S. all at once.

              I hope to soon check out virtualbox

              reputed to have a way to (on Linux) run a Win O.S. with Win hidden in
              the background and to seamlessly integrate into your Linux desktop,
              whatever or whichever Win apps you want.

              You can buy a new Dell nowadays with Linux on it. (I don't know if
              that's a sign of a trend or not).

              Wine (Linux software) has been going that/this route too -- a (Windows
              app) "Notetab" window just as if it's a part of the Linux desktop
              (rather than to fire up any Win apps in a seperate or special "for Win
              apps" window or go through a special procedure just to use Win apps)

              --
              Alan.
            • Sheri
              ... I m still entrenched in Windows myself, but definitely not attracted to Vista, so you never know. PCRE comes from a Linux environment btw. Also, its my
              Message 6 of 14 , Nov 1, 2007
              • 0 Attachment
                --- In ntb-scripts@yahoogroups.com, "Alan C" <acummingsus@...> wrote:

                > You can buy a new Dell nowadays with Linux on it. (I don't know if
                > that's a sign of a trend or not).

                I'm still entrenched in Windows myself, but definitely not attracted
                to Vista, so you never know. PCRE comes from a Linux environment btw.
                Also, its my understanding that in some of the latest versions of Perl
                you can tell it to use PCRE for regex matching! One of the reasons I
                like PCRE is we get use some of the latest developments in regex/Perl.
                PCRE has features of Perl 5.10 but the latest ActiveState Perl I can
                get is still several years old (around 5.8.8).

                Regards,
                Sheri
              • Alan C
                ... I m a subscriber at next http://www.theperlreview.com/ At there, can see in Perl 5.9.5 (devel, not stable) has named captures, coming in Perl 5.10 Does
                Message 7 of 14 , Nov 1, 2007
                • 0 Attachment
                  On Nov 1, 2007 2:05 PM, Sheri <silvermoonwoman@...> wrote:
                  > --- In ntb-scripts@yahoogroups.com, "Alan C" <acummingsus@...> wrote:
                  >
                  > > You can buy a new Dell nowadays with Linux on it. (I don't know if
                  > > that's a sign of a trend or not).
                  >
                  > I'm still entrenched in Windows myself, but definitely not attracted
                  > to Vista, so you never know. PCRE comes from a Linux environment btw.
                  > Also, its my understanding that in some of the latest versions of Perl
                  > you can tell it to use PCRE for regex matching! One of the reasons I
                  > like PCRE is we get use some of the latest developments in regex/Perl.
                  > PCRE has features of Perl 5.10 but the latest ActiveState Perl I can
                  > get is still several years old (around 5.8.8).

                  I'm a subscriber at next

                  http://www.theperlreview.com/

                  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)

                  --
                  Alan.
                • 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 8 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 9 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 10 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 11 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 12 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.