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

Re: Re: [Clip] Questions about the reg exp. engine. in Notetab

Expand Messages
  • Alec Burgess
    ... This appears to be the one that gives the closure error. I think in some regex dialects a ? is used to request a non-greedy match but AFAIK in Notetab s
    Message 1 of 9 , Feb 3, 2005
    • 0 Attachment
      dvdwriter:

      > {.*?}

      This appears to be the one that gives the closure error.
      I think in some regex dialects a ? is used to request a non-greedy match but
      AFAIK in Notetab's version "?" is one of three alternate closures ie:
      ? - exactly one
      + - one or more
      * - zero or more

      I don't think its ever legal to have two of these in succession as you do in
      the expression above.

      What did you want/expect it was going to be able to match?

      Regards ... Alec
      --
      ( ) { } [ ] \ | 9 0 + = () {} []


      ---- Original Message ----
      From: "dvdwriters12" <dvdwriters@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Wednesday, February 02, 2005 20:47
      Subject: [gla: Re: [Clip] Questions about the reg exp.
      engine. in Notetab

      > Thanks Alan that cleared up quite a few things.
      >
      > However I'm getting an error with the following:
      >
      > <!-- test:{[A-Z0-9]+}\s -->
      > <!-- START -->
      > {.*?}
      > <!-- END -->
      >
      > Which works fine in other programs but brings on error in
      > notetab about closures
    • dvdwriters12
      It was meant to match anything between the two tags. {.*?} Its for code for a banner. I want to capture
      Message 2 of 9 , Feb 3, 2005
      • 0 Attachment
        It was meant to match anything between the two tags.

        <!-- test:{[A-Z0-9]+}\s -->
        <!-- START -->
        {.*?}
        <!-- END -->

        Its for code for a banner. I want to capture after scanning where it
        is in the file and change the html code between the two tags with
        something new.

        The html banner code could span multiple lines and could be in diff.
        but its always between those two tags and I search for it with
        test:{[A-Z0-9]+}\s on the line above it.

        It was made before I heard about Notetab and was the only way to do
        it.

        >
        > the expression above.
        >
        > What did you want/expect it was going to be able to match?
        >
        > Regards ... Alec
        > --
        > ( ) { } [ ] \ | 9 0 + = () {} []
        >
        >

        > > <!-- test:{[A-Z0-9]+}\s -->
        > > <!-- START -->
        > > {.*?}
        > > <!-- END -->
        > >
        > > Which works fine in other programs but brings on error in
        > > notetab about closures
      • Alec Burgess
        Hi dvdwriter: If you *know* that there is just one occurence of in the document then this should allow you to replace everything between the START
        Message 3 of 9 , Feb 3, 2005
        • 0 Attachment
          Hi dvdwriter:

          If you *know* that there is just one occurence of <!-- END --> in the
          document then this should allow you to replace everything between the START
          and END tags by "whatever":

          ^!replace "{<!-- START -->}{\a*}{<!-- END -->}" >> "\1whatever\3" rws

          If you have to worry about multiple <!-- END --> tags you could modify the
          "Select between tags" clip in the Utilities library.
          Regards ... Alec
          --
          ( ) { } [ ] \ | 9 0 + = () {} []


          ---- Original Message ----
          From: "dvdwriters12" <dvdwriters@...>
          To: <ntb-clips@yahoogroups.com>
          Sent: Thursday, February 03, 2005 08:59
          Subject: [gla: Re: [Clip] Questions about the reg exp.
          engine. in Notetab

          > It was meant to match anything between the two tags.
          >
          > <!-- test:{[A-Z0-9]+}\s -->
          > <!-- START -->
          > {.*?}
          > <!-- END -->
          >
          > Its for code for a banner. I want to capture after
          > scanning where it is in the file and change the html code
          > between the two tags with something new.
          >
          > The html banner code could span multiple lines and could
          > be in diff. but its always between those two tags and I
          > search for it with test:{[A-Z0-9]+}\s on the line above
          > it.
          >
          > It was made before I heard about Notetab and was the only
          > way to do it.
        • Alan_C
          Hi, Great ideas Alec shared. Follows, just an idea (that s all, nothing more) U decide if is feasible: (this might be if there are or happen to be more than
          Message 4 of 9 , Feb 3, 2005
          • 0 Attachment
            Hi,

            Great ideas Alec shared.

            Follows, just an idea (that's all, nothing more) U decide if is feasible:

            (this might be if there are or happen to be more than one of the start
            or end tags)

            If dvdwriter knows how many lines the banner spans

            then, find the start tag then jump select a few lines then replace ^p
            (remove the line breaks) then would have one line to process

            Not that it's a MUST to have one line to process with a regex. But the
            default record separator in Notetab is the line break (meaning that the
            regex grabs one line at a time) unless you pass something to it like
            Alec did there to make it do otherwise but then also I think, careful,
            as Alec mentioned, of the greed issue.

            dvdwriter I wasn't sure that I had it straight what U seeking earlier:
            yes the regex command/code must be a one liner. More, though the
            default record separator is the line break (easier to regex when
            processing snags one line at a time), it is possible to make it process
            so as to go beyond the default setting. | Alan.

            Alec Burgess wrote:
            > Hi dvdwriter:
            >
            > If you *know* that there is just one occurence of <!-- END --> in the
            > document then this should allow you to replace everything between the START
            > and END tags by "whatever":
            >
            > ^!replace "{<!-- START -->}{\a*}{<!-- END -->}" >> "\1whatever\3" rws
            >
            > If you have to worry about multiple <!-- END --> tags you could modify the
            > "Select between tags" clip in the Utilities library.
            > Regards ... Alec
            ---- Original Message ---- From: "dvdwriters12" <dvdwriters@...>
            To: <ntb-clips@yahoogroups.com> Sent: Thursday, February 03, 2005 08:59
            Subject: [gla: Re: [Clip] Questions about the reg exp. engine. in Notetab
            >> It was meant to match anything between the two tags.
            >>
            >> <!-- test:{[A-Z0-9]+}\s -->
            >> <!-- START -->
            >> {.*?}
            >> <!-- END -->
            >>
            >> Its for code for a banner. I want to capture after
            >> scanning where it is in the file and change the html code
            >> between the two tags with something new.
            >>
            >> The html banner code could span multiple lines and could
            >> be in diff. but its always between those two tags and I
            >> search for it with test:{[A-Z0-9]+}\s on the line above
            >> it.
          • dvdwriters12
            Hi Alec, Your find / replace does work but it s not very useful as I have more than one banner on a page and using it deletes the rest of the banners. I m not
            Message 5 of 9 , Feb 4, 2005
            • 0 Attachment
              Hi Alec,

              Your find / replace does work but it's not very useful as I have
              more than one banner on a page and using it deletes the rest of the
              banners.

              I'm not sure why Notetab is the only program that thinks

              {.*?}

              is not legal.

              Cheers


              --- In ntb-clips@yahoogroups.com, "Alec Burgess" <burale@a...> wrote:
              > Hi dvdwriter:
              >
              > If you *know* that there is just one occurence of <!-- END --> in
              the
              > document then this should allow you to replace everything between
              the START
              > and END tags by "whatever":
              >
              > ^!replace "{<!-- START -->}{\a*}{<!-- END -->}" >> "\1whatever\3"
              rws
              >
              > If you have to worry about multiple <!-- END --> tags you could
              modify the
              > "Select between tags" clip in the Utilities library.
              > Regards ... Alec
            Your message has been successfully submitted and would be delivered to recipients shortly.