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

[NTB] Regular Expression Find and Replace Problems

Expand Messages
  • chuckanderso@earthlink.net
    I m getting lots of odd results when I try to use regular expression Find and Replace. When I want to insert a space at the beginning of every line in a plain
    Message 1 of 6 , Jul 4, 1999
    • 0 Attachment
      I'm getting lots of odd results when I try to use regular expression
      Find and Replace.

      When I want to insert a space at the beginning of every line in a plain
      old text file;

      I say Find "^"
      and replace with "^ " [with no quotes]

      and hit Replace All. The Find and Replace program gets lost and hangs
      forever.
      If I hit Find Next (before trying Replace All) it does nothing.

      If I say

      Find "$"
      and Replace with "$ZZZ"

      and hit Replace All, Find and Replace selects five lines (there are at
      least twenty in the document) and makes the replacements. Why doesn't
      it do that to every line? I've used show non-printing and every line
      has a paragraph mark (CR?) at the end of it. I can't see any
      difference between lines that were changed and others.

      If I reuse this command a few times it eventually hangs the Find and
      Replace program, too.

      I'm looking for an error specific to my system, but I can't find it.

      Should these Regular Expressions I'm using work correctly in Find and
      Replace? They seem simple enough to me. I need help figuring out
      what's wrong.


      ------------------------------------------------------------------------

      eGroups.com home: http://www.egroups.com/group/notetab
      http://www.egroups.com - Simplifying group communications
    • Wayne VanWeerthuizen
      ... The regular expression parser used by NoteTab has serious flaws. Your options are to wait for a newer version, or to use another utility alongside NoteTab,
      Message 2 of 6 , Jul 4, 1999
      • 0 Attachment
        chuckanderso@... wrote:
        >I'm getting lots of odd results when I try to use regular expression
        >Find and Replace.

        >Should these Regular Expressions I'm using work correctly in Find and
        >Replace? They seem simple enough to me. I need help figuring out
        >what's wrong.

        The regular expression parser used by NoteTab has serious flaws.

        Your options are to wait for a newer version, or to use another
        utility alongside NoteTab, such as awk or perl. Check out the
        clipbook "NoteAwk" on my homepage which has some clips for
        facilitating this.


        --
        Wayne M. VanWeerthuizen
        ICQ: 15117288
        Homepage: http:/landru.myhome.net/wayne


        ------------------------------------------------------------------------

        eGroups.com home: http://www.egroups.com/group/notetab
        http://www.egroups.com - Simplifying group communications
      • Larry Thomas
        Hi Chuck, ... ^ looks for nothing at the beginning of the line and finds it and replaces it with the caret and a space. It does not matter how many times it
        Message 3 of 6 , Jul 4, 1999
        • 0 Attachment
          Hi Chuck,

          At 01:19 PM 7/4/1999 -0700, you wrote:
          >I'm getting lots of odd results when I try to use regular expression
          >Find and Replace.
          >
          >When I want to insert a space at the beginning of every line in a plain
          >old text file;
          >
          >I say Find "^"
          >and replace with "^ " [with no quotes]
          >
          >and hit Replace All. The Find and Replace program gets lost and hangs
          >forever.

          "^" looks for nothing at the beginning of the line and finds it and
          replaces it with the caret and a space. It does not matter how many times
          it finds nothing at the beginning of a line, if you have it searching for
          nothing it will always find it and it will lock up in a loop finding it
          over and over again.

          The second problem is that regular expressions are not impliment in the
          replace side of search and replace. You can use them for searching but not
          for replacing. Your statement will not replace with a space but with a
          caret and a space.

          >If I hit Find Next (before trying Replace All) it does nothing.

          Because it finds nothing ;-)

          >If I say
          >
          >Find "$"
          >and Replace with "$ZZZ"
          >
          >and hit Replace All, Find and Replace selects five lines (there are at
          >least twenty in the document) and makes the replacements. Why doesn't
          >it do that to every line? I've used show non-printing and every line
          >has a paragraph mark (CR?) at the end of it. I can't see any
          >difference between lines that were changed and others.
          >
          >If I reuse this command a few times it eventually hangs the Find and
          >Replace program, too.
          >
          >I'm looking for an error specific to my system, but I can't find it.
          >
          >Should these Regular Expressions I'm using work correctly in Find and
          >Replace? They seem simple enough to me. I need help figuring out
          >what's wrong.

          With each of these do not use regular expressions. Use a regular search
          and replace and find ^p and replace with ^p and a space. ^p represents a
          charage return and since it is at the end of each line, the space will be
          at the beginning of the next line.

          For the last find ^p and replace with ZZZ^p.

          You can insert an extra blank line before your selection to get the first
          line right and then delete it after.

          Regards,

          Larry
          larryt@...

          ------------------------------------------------------------------------

          eGroups.com home: http://www.egroups.com/group/notetab
          http://www.egroups.com - Simplifying group communications
        • Charles M. Raine
          ... Wayne: As you can see above your Homepage address is missing a / Charlie. Charles M. Raine Home Page: http://www.escape.ca/~rainec Phone (204)
          Message 4 of 6 , Jul 4, 1999
          • 0 Attachment
            At 09:00 PM 7/4/1999 +0000, you wrote:
            >Check out the
            >clipbook "NoteAwk" on my homepage which has some clips for
            >facilitating this.
            >--
            >Wayne M. VanWeerthuizen
            >ICQ: 15117288
            >Homepage: http:/landru.myhome.net/wayne
            >
            Wayne: As you can see above your Homepage address is missing a /

            Charlie.

            Charles M. Raine Home Page: http://www.escape.ca/~rainec
            Phone (204) 895-0940 ICQ Pager: http://wwp.mirabilis.com/300058

            Winnipeg, Manitoba, Canada ICQ # 300058



            ------------------------------------------------------------------------

            eGroups.com home: http://www.egroups.com/group/notetab
            http://www.egroups.com - Simplifying group communications
          • Kay Roath
            07/04/1999 1:19 PM chuckanderso@earthlink.net wrote ... NoteTab uses a token (^p) for CR/LF. To put a space at the start of each line, replace ^p with ^p
            Message 5 of 6 , Jul 5, 1999
            • 0 Attachment
              07/04/1999 1:19 PM chuckanderso@... wrote
              > I'm getting lots of odd results when I try to use regular expression
              > Find and Replace.

              > When I want to insert a space at the beginning of every line in a plain
              > old text file;

              > I say Find "^"
              > and replace with "^ " [with no quotes]

              NoteTab uses a token (^p) for CR/LF. To put a space at the
              start of each line, replace '^p' with '^p '. That's a
              regular NoteTab replace not using RegEx.

              NoteTab tokens are
              ^L = Line Feed
              ^C = Carriage Return
              ^P = Line Feed/Carriage Return combo
              ^B = New Page
              ^T = Tab

              As long as you know the text you want to find/replace,
              NoteTab can handle it fine without RegEx :)

              --- Grandma Kay ---
              Introduction to NoteTab Clip Programming
              http://notetab.kay.net



              ------------------------------------------------------------------------

              eGroups.com home: http://www.egroups.com/group/notetab
              http://www.egroups.com - Simplifying group communications
            • chuckanderso@earthlink.net
              wrote: original article:http://www.egroups.com/group/notetab/?start=5341 ... Thanks for all the interesting and very useful replies.
              Message 6 of 6 , Jul 7, 1999
              • 0 Attachment
                <7lofjr$5lh-@egroups.com> wrote:
                original article:http://www.egroups.com/group/notetab/?start=5341
                > I'm getting lots of odd results when I try to use regular expression
                > Find and Replace.

                Thanks for all the interesting and very useful replies. I mean it!
                And now I even found the tokens in Note Tab Pro Help.

                Mille Grazi



                ------------------------------------------------------------------------

                eGroups.com home: http://www.egroups.com/group/notetab
                http://www.egroups.com - Simplifying group communications
              Your message has been successfully submitted and would be delivered to recipients shortly.