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

Re: [Clip] Find/Replace between two tokens

Expand Messages
  • skyflyerdezign
    ... wrote: Well, I think I will wrap this thread up soon. I have lot s to learn, but have made some progress over the past few days. Some of the cryptic
    Message 1 of 16 , May 16, 2007
      --- In ntb-clips@yahoogroups.com, "skyflyerdezign" <bobserack@...>
      wrote:

      Well, I think I will wrap this thread up soon.
      I have lot's to learn, but have made some progress over the past few
      days. Some of the cryptic language is now starting to make sense!
      I will keep working at it.

      Just wanted to comment on three different ideas I was given to try.

      'Axel Berger' suggested ...
      I can never remember all of those and don't write expressions without
      consulting help. That's why I rather kept my answer short than give a
      wrong one. This should work:
      ^!Replace "w.resizeTo\(\d{1,4},\d{1,4}\);" >> " " WRAS

      'Don Daugherty' suggested (And I am using 4.95, so I tried that
      suggestion).
      In 4.95 you could use (I'll give the clip version but you could just do
      it directly in the Find/Replace dialog box, with use RegX checked)
      ^!Replace "w\.resizeTo\c\d\d?\d?, \d\d?\d?\c;" >> " " RWA
      In 5.x you could use
      ^!Replace "w.resizeTo\c\d{1,3}, \d{1,3}\c;:" >> "" RWA

      'Don - HtmlFixIt.com'
      If I had a better sample (is there a link?) I could check myself.
      I believe if you simply open it and use this:
      w.resizeTo\(.+\)\;

      'notetab_is_great' suggested in refering to Don HtmlFixIt's code ...
      This will backfire... it would match w.resizeTo(638,685); some good
      stuff here w.resizeTo(640,480);
      You either need to change .+ to .+? -- non-greedy quantifier -- or to
      [^)]+ -- to avoid consuming right parenthesis as part of .+
      ... and Don HtmlFixIt concurred in a later message.

      I don't understand why than needs to be done and what the heck is
      'greedy' all about?!!
      Doesn't adding a '?' mean matches zero or one matches of the regular
      expression?
      And I still can't find reference to code such as ... \d{1,4},
      What does the 1,4 stand for. I doubt it is position 1 for a length of
      4.

      Anyway, I tried all three methods. Don - HtmlFixIt's simple solution
      worked right out of the box. It appeared to change my code correctly,
      so I am not sure what the discussion about adding a '?' would do.

      The other two solutions did not work for me. I did a copy and paste, so
      I'm sure I got it right.
      I plan on spending some time with them to see if I can figure out why
      they didn't work.
      Maybe on a rainy day ...

      Anyway, thanks again guys ...
      I appreciated the help ... Bob



      [Non-text portions of this message have been removed]
    • Don - HtmlFixIt.com
      Hi Bob, Have a look here: http://tech.groups.yahoo.com/group/ntb-clips/message/15918 She gives a reference to a source that will explain greedy and non-greedy
      Message 2 of 16 , May 16, 2007
        Hi Bob,

        Have a look here:
        http://tech.groups.yahoo.com/group/ntb-clips/message/15918

        She gives a reference to a source that will explain greedy and
        non-greedy identifiers.

        Don
      • Axel Berger
        ... Now that you have told us you use 4.95 you probably wouldn t. I m new to NoteTab and only started with 5.0, but I believe the wavy brackets were only added
        Message 3 of 16 , May 17, 2007
          skyflyerdezign wrote:
          > And I still can't find reference to code such as ... \d{1,4},

          Now that you have told us you use 4.95 you probably wouldn't. I'm new to
          NoteTab and only started with 5.0, but I believe the wavy brackets were
          only added then. It means "\d" decimal digit "{1,4}" numbering from at
          least one to for at most.

          > I don't understand why than needs to be done and what the heck is
          > 'greedy' all about?!!
          > Doesn't adding a '?' mean matches zero or one matches of the regular
          > expression?

          As a quantifier yes. Written directly after a quantifier it becomes a
          modifier. As in your example you often have a beginning, a variable
          middle, and an end. Regex tries to find and match as much as possible so
          your "variable middle" may well contain the end, some unrelated text in
          between and the beginning of the next instance plut its variable middle,
          which is not what you want. I use the "?" modifier for "match as little
          as possible" all the time.

          > The other two solutions did not work for me. I did a copy and paste, so

          They wouldn't with 4.95. I'm not one of the "always use the newest and
          flashiest" brigade (still on Win98) but with NoteTab and at its price
          I'd really recommend upgrading, if only for the sake of being on a par
          with most helpful people in here.

          Axel
        • skyflyerdezign
          ... Point taken. It is indeed a powerful product for the price. And that would explain why some of the suggested samples didn t work for me. I ll plan on the
          Message 4 of 16 , May 17, 2007
            --- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:

            Point taken.
            It is indeed a powerful product for the price.
            And that would explain why some of the suggested samples didn't work
            for me.
            I'll plan on the upgrade.
            Thanks again for the help ...
            Bob



            > I'd really recommend upgrading, if only for the sake of being on a par
            > with most helpful people in here.
            >
            > Axel
            >
          • skyflyerdezign
            ... This could be duplicate post. Provider issues ... Point taken. It is indeed a powerful product for the price. And that would explain why some of the
            Message 5 of 16 , May 17, 2007
              --- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:

              This could be duplicate post. Provider issues ...

              Point taken.
              It is indeed a powerful product for the price.
              And that would explain why some of the suggested samples didn't work
              for me.
              I'll plan on the upgrade.
              Thanks again for the help ...
              Bob


              > I'd really recommend upgrading, if only for the sake of being on a par
              > with most helpful people in here.
              >
              > Axel
              >
            • skyflyerdezign
              ... This could be duplicate post. Provider issues ... Point taken. It is indeed a powerful product for the price. And that would explain why some of the
              Message 6 of 16 , May 17, 2007
                --- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:

                This could be duplicate post. Provider issues ...

                Point taken.
                It is indeed a powerful product for the price.
                And that would explain why some of the suggested samples didn't work
                for me.
                I'll plan on the upgrade.
                Thanks again for the help ...
                Bob


                > I'd really recommend upgrading, if only for the sake of being on a par
                > with most helpful people in here.
                >
                > Axel
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.